Jump to content

Recommended Posts

Posted (edited)

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
Posted

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Posted (edited)

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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...