Jump to content
Sign in to follow this  
evilelf

Label Problem

Recommended Posts

evilelf

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

Share this post


Link to post
Share on other sites
KenNichols

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!

Share this post


Link to post
Share on other sites
evilelf

Thank You, I'll check this out soon as I can and ill post back.

; Edited

- Thank You , 'KenNichols'.

Works 100% and no problems.

Edited by evilelf

Share this post


Link to post
Share on other sites
evilelf

* 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

Share this post


Link to post
Share on other sites
evilelf

Bumb for today, I still cant seem to figure this one out.

I'm going to be out today so maybe ill think of something fresh.


Share this post


Link to post
Share on other sites
Zedna

$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

Share this post


Link to post
Share on other sites
evilelf

Thank you.

It works but a bit flashing for right now, thats my bad.

Thank you again.


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  

×