Jump to content

Repeating label


stev379
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

#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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...