Sign in to follow this  
Followers 0
Nova

My GUI edit

3 posts in this topic

Im sure thsi is something really simple and im going to kick myself when I find out what im doing wrong but here goes anyway !

How can I make the text sent to a GUICtrlEdit appear letter by letter as if its being typed ?

The below code makes all lines of text appear at once !

Ive messed with SendKeyDelay,Send and ControlSend but I cant seem to get the effect im looking for !

#include <GUIConstants.au3>

GUICreate("My GUI edit") ; will create a dialog box that when displayed is centered

$Info=GUICtrlCreateEdit ("", 176,32,121,97,$ES_AUTOVSCROLL)

GUISetState ()

Send ("Hello: This is my first GUI edit !")

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Share this post


Link to post
Share on other sites



Maybe something like this. I think controlsend is a bit better.

#include <GUIConstants.au3>

GUICreate("My GUI edit"); will create a dialog box that when displayed is centered

$Info=GUICtrlCreateEdit ("", 176,32,121,97,$ES_AUTOVSCROLL)

GUISetState ()

$send="Hello: This is my first GUI edit !"

; Run the GUI until the dialog is closed
While 1
controlsend("My GUI edit","","Edit1",StringLeft($send,1))
$send=StringTrimLeft($send,1)
sleep(300)
   $msg = GUIGetMsg()
   
   If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

- or use GUICTRLsetData like:

#include <GUIConstants.au3>
GUICreate("My GUI edit"); will create a dialog box that when displayed is centered
$Info = GUICtrlCreateEdit("", 176, 32, 121, 97, $ES_AUTOVSCROLL)
GUISetState(@SW_SHOW)
Sleep(1000)
;opt("Sendkeydelay",500)
$Txt = "Hello: This is my first GUI edit !"
For $x = 1 To StringLen($Txt)
   GUIctrlsetdata($info,StringLeft($txt,$x))
   Sleep(200)
Next
; Run the GUI until the dialog is closed
While 1
   $msg = GUIGetMsg()
   If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  
Followers 0