Jump to content

how to disable the flashing effect when updating label


Recommended Posts

tôi viết một chương trình đọc một tệp tin văn bản sau và in nó ra từ từ

a.txt

aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
dddddddddddddddddddddddddd
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
dddddddddddddddddddddddddd
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
dddddddddddddddddddddddddd
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
dddddddddddddddddddddddddd
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
dddddddddddddddddddddddddd
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
dddddddddddddddddddddddddd
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
dddddddddddddddddddddddddd
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
dddddddddddddddddddddddddd
#include <GUIConstants.au3>
#include <File.au3>
#include <String.au3>

Local $Form1 = GUICreate("AForm1", 625, 443, 193, 115)
Local $Label1 = GUICtrlCreateLabel("dsasd", 32, 16, 577, 412)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)

Local $readtext = _FileCountLines(@ScriptDir & "\a.txt")
For $i = 1 To $readtext
    $linetext = FileReadLine(@ScriptDir & "\a.txt", $i)
    $Str = StringSplit($linetext, "")
    For $o = 1 To $Str[0]
        GUICtrlSetData($Label1, GUICtrlRead($Label1) & StringMid($linetext, $o, 1))
        If ($o == $Str[0]) Then GUICtrlSetData($Label1, GUICtrlRead($Label1) & @CRLF)
        Sleep(20)
    Next
Next

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
 

---> Works Well

but there is a problem 
 
it continuously blinks and looks so bad how all the characters on screen are standing still and not blink
 
post-84392-0-29858000-1409671703_thumb.g
 
>
Edited by scila1996
Link to post
Share on other sites

tôi viết một chương trình đọc một tệp tin văn bản sau và in nó ra từ từ

Translates to:

"I wrote a program that reads a text file and then print it out slowly"

Adjust the Sleep(20) and see what happens. Try Sleep(100)

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to post
Share on other sites

Try:

 

include <GUIConstants.au3>
#include <File.au3>
#include <String.au3>
#include <WindowsConstants.au3>


Local $Form1 = GUICreate("AForm1", 625, 443, 193, 115, Default,BitOR($WS_EX_COMPOSITED, $WS_EX_LAYERED))
...
Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to post
Share on other sites

I cannot see any blinking when changing the sleep value.

What you can try is to use GDI+ to have flicker free text printing. There are several examples how to use GDI+ for such tasks.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...