Jump to content

how to avoid label flash?


gooker
 Share

Recommended Posts

i write a script ,and use edit and graph, every second will refresh the data of the edit and the graph.

i found the edit and the graph flash .

so i write a small example to show it.

is anybody can sovle the problem?

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 443, 192, 124)
$Label1 = GUICtrlCreateLabel("Label1", 5, 5, 636, 617)
GUICtrlSetFont(-1, 39, 400, 4) 
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

AdlibRegister("MyAdlib",100)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func MyAdlib()
    GUICtrlSetData($Label1,"Do you see the label flash? and how to sovle it ?")
EndFunc
Edited by gooker
Link to comment
Share on other sites

@thanubis ths

but this also have the problem

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 443, 192, 124)
$Label1 = GUICtrlCreateLabel("Label1", 5, 5, 636, 617)
GUICtrlSetFont(-1, 39, 400, 4)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

AdlibRegister("MyAdlib",500)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func MyAdlib()
    If GUICtrlRead($Label1) <> @SEC&"test test test test test test test test test test test test" Then GUICtrlSetData($Label1, @SEC&"test test test test test test test test test test test test")
EndFunc
Edited by gooker
Link to comment
Share on other sites

@thanubis ths

but this also have the problem

I also have the same problem, who can solve the following?

:D

Try adding the $WS_EX_COMPOSITED style to the GUI:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 443, 192, 124, -1, $WS_EX_COMPOSITED)
$Label1 = GUICtrlCreateLabel("Label1", 5, 5, 636, 617)
GUICtrlSetFont(-1, 39, 400, 4)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

AdlibRegister("MyAdlib",500)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func MyAdlib()
    If GUICtrlRead($Label1) <> @SEC&" test test test test test test test test test test test test" Then GUICtrlSetData($Label1, @SEC&" test test test test test test test test test test test test")
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...