Jump to content
Sign in to follow this  
gooker

how to avoid label flash?

Recommended Posts

gooker

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

Share this post


Link to post
Share on other sites
enaiman

ControlSetText instead of GUICtrlSetData


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites
gooker

the code is just a sample,i need to changed label data every second ,and it also have this problem, even just show the time .

@enaiman ,i use ,but also have the problem.


Share this post


Link to post
Share on other sites
gooker

@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

Share this post


Link to post
Share on other sites
zhuzb

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

:D

Share this post


Link to post
Share on other sites
ResNullius

@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

Share this post


Link to post
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
Sign in to follow this  

×