Jump to content
Sign in to follow this  
stev379

Repeating label

Recommended Posts

stev379

How can I have a label print one charactor to a GUI window, then loop around and print again, but one charactor to the right?

It's obvious this won't work, so I thought I'd check for any ideas... Thanks!

EXAMPLE:

_Rows()

Func _Rows()
    
$i = 0
Do  
$01 = Random(0, 15, 1)
$Label_01 = GUICtrlCreateLabel($01, $i, 0, 400,400);61 charactors
Sleep (100)
Until $i = 400

EndFunc
Edited by stev379

Share this post


Link to post
Share on other sites
stev379

Yeah, I just realized that.

This is the newer code and it does what I want but it blanks out the previous label. I'd like it to go sort of like:

12345

Not

(All of below would be on the same line, it's just that the preceding number gets blanked)

1

_ 2

__ 3

___ 4

____ 5

EDIT: I got it...had to increase the $i variable by the width of a character

Func _Rows()
    
    $i = 0
    Do  
        
        $01 = Random(0, 15, 1)
        
        $Label_01 = GUICtrlCreateLabel($01, $i, 0, 12,15) 
        
            Sleep (100)
        
        $i = $i + 12   ;Prior to EDIT this was $i = $i + 1
    
    Until $i = @DesktopWidth

EndFunc;_Rows()
Edited by stev379

Share this post


Link to post
Share on other sites
Jos

You dont want to create a LABEL everytime, but once and then update the LABEL with GUICtrlSetData().


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

Share this post


Link to post
Share on other sites
stev379

That figures...lol

I just figured out how to do it my way. Now I need to go back and do it the correct way. B)

Share this post


Link to post
Share on other sites
w0uter

#include <GuiConstants.au3>


Func _Rows()
    
    For $i = 0 to @DesktopWidth step 12     
        GUICtrlCreateLabel(Random(0, 15, 1), $i, 0, 12,15)
    Next

EndFunc;_Rows()


GuiCreate("How is This ?", @DesktopWidth, 15, 0, 0)
_Rows()
GuiSetState()

While 1
    Switch GuiGetMsg()
    Case $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSwitch
WEnd


My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.