Jump to content

Label Changing


 Share

Recommended Posts

I've looked through the help file for awhile now and I can't find it.

How do I change the data on a label?

Example:

Label says: Hi

Then when the button is clicked or something I want it to say Bye!

Please help hope I explained clearly enough.

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

GuiCreate("Labelchangomatic")
$lbl = GuiCtrlCreateLabel("hello", 10, 10)
$btn = GuiCtrlCreateButton("changit", 20, 20)
GuiSetState()
While 1
$msg = GuiGetMsg()
Select
Case $msg = -3
exit
Case $msg = $btn
GuiCtrlSetData($lbl, GetToggle(GuiCtrlRead($lbl)))
EndSelect
WEnd

Func GetToggle($stext)
if $stext = "hello" then
return "goodbye"
else
return "hello"
endif
endfunc

Just threw this together, but you should get the idea.

~cdkid

Edited by cdkid
AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

seems to return

C:\AutoIt3\gui_test.au3 (11) : ==> "Wend" statement with no matching "While" statement.: 
WEnd

when i try it, but I think i figured it out though

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

I know, i saw the errors, so i fixed em.. try it now if you wanna see it.

~cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
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...