Jump to content

Label Problem


 Share

Recommended Posts

Basically Im making a label that will re-fresh upon whenever

Func CheckConnection() is called. First I need to wait for the window

to exist then update the GUI like I wanted.

- Ill figure out the Func Part but, Right now my ' ControlSetText '

Is making my App look double font like.

Im new working with GUI but i think its the While part.

N the next few hours, when im home I have a idea to fix this.

I'll post my finddings but please if anyone can help post.

()

If WinActive(" Title ") Then

ControlSetText($Form1, "", $Status,"Status: Connected")

ElseIf

ControlSetText($Form1, "", $Status,"Status: Not Connected")

EndIf

and so on....

()

$Status = GUICtrlCreateLabel("Status: Not Connected", 352, 72, 100, 37)

Func SmartBehavior()

While $wait = 0

;Checks If Window is Running then Updates The GUI - First time... DUH

While $hello = 0

$MainWindow = WinExists(" Title ")

If $MainWindow = 0 Then

ControlSetText($Form1, "", $Status,"Status: Not Connected")

ToolTip("Failed to read Program, Please Run Program Now.",0,0)

Sleep(90)

ElseIf $GuildWars = 1 Then

$hello = 1

Sleep(90)

ControlSetText($Form1, "", $Status,"Status: Connected")

EndIf

WEnd

Edited by evilelf
Link to comment
Share on other sites

Basically Im making a label that will re-fresh upon whenever

Func CheckConnection() is called. First I need to wait for the window

to exist then update the GUI like I wanted.

- Ill figure out the Func Part but, Right now my ' ControlSetText '

Is making my App look double font like.

Im new working with GUI but i think its the While part.

N the next few hours, when im home I have a idea to fix this.

I'll post my finddings but please if anyone can help post.

()

If WinActive(" Title ") Then

ControlSetText($Form1, "", $Status,"Status: Connected")

ElseIf

ControlSetText($Form1, "", $Status,"Status: Not Connected")

EndIf

and so on....

()

I think you are looking for

GUICtrlSetData ( controlID, data [, default] )

GUICtrlSetData (Status, "Status: Not Connected")

[topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner!
Link to comment
Share on other sites

* New Problem, But Same Topic *

I really dont know the problem, Ive looked thrue the AutoIt Help

& theres nothing to help me. My 3 will update my lable as 29 or something else.

Need more depth ill post, Im just looking for some help.

Im trying to update something on my GUI like so.

$LabelCount = GUICtrlCreateLabel("Total: 0 / 0", 296, 96, 91, 17)
$User_FileCount = GUICtrlCreateInput("3", 256, 88, 57, 21,$ES_NUMBER)
; some code

GUISetState(@SW_SHOW)
;Other Code.

If GUICtrlRead($User_FileCount) = 0 Then
        MsgBox(0,"Error","Your Number Must be Greater Then Zero, Please ReStart App.")
        Exit
    EndIf
        
GUICtrlRead($User_FileCount)
GUICtrlSetData($LabelCount,$User_FileCount)
Edited by evilelf
Link to comment
Share on other sites

$LabelCount = GUICtrlCreateLabel("Total: 0 / 0", 296, 96, 91, 17)
$User_FileCount = GUICtrlCreateInput("3", 256, 88, 57, 21,$ES_NUMBER)
; some code

GUISetState(@SW_SHOW)
;Other Code.

$FileCount = GUICtrlRead($User_FileCount)

If $FileCount = 0 Then
       MsgBox(0,"Error","Your Number Must be Greater Then Zero, Please ReStart App.")
       Exit
EndIf
       
GUICtrlSetData($LabelCount,$FileCount)

Edited by Zedna
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...