Sign in to follow this  
Followers 0
Muchuchu

Problem connecting GUI to Script

3 posts in this topic

I want a message box to pop up once i hit the pop buttonv ($popbut) but i can't quite seem to figure out why it won't. I must be doing something wrong

#include <GUIConstants.au3>


#Region ### START Koda GUI section ### Form=
  $Form2 = GUICreate("Autoit Program Test", 200, 200, 180, 100)
  $Label1 = GUICtrlCreateLabel("Press ESCAPE to start!", 20, 15, 120, 15)
  $Label2 = GUICtrlCreateLabel("Press BACKSPACE to exit!", 20, 120, 140, 15)
  $Connect = GUICtrlCreateButton("Pick Color!",20, 35, 55, 20)

GUISetState(@SW_SHOW)
  #EndRegion ### END Koda GUI section ###
 


$hexColor=GUICtrlCreateInput("", 80, 60, 90, 20,$ES_READONLY)
GUICtrlCreateLabel("Color:", 20, 85)
GUICtrlCreateLabel("Color Code", 20, 60)
$MostrarColor=GUICtrlCreateLabel("", 80, 85, 90, 20,$ES_READONLY)
GUICtrlCreateLabel("Press Pause/Break to freeze color.", 0, 140 ,200, 15, $SS_CENTER)
GUICtrlSetColor(-1,0x00808080)
$popbut = GUICtrlCreateButton("Pop",20, 160, 55, 20)



GUISetState()



While 1
    $msg=GUIGetMsg()
    Select
    Case $msg=$GUI_EVENT_CLOSE
        exit
    EndSelect
WEnd


while 1
    $msg = GUIGetMsg()
    if $msg = $popbut then
        msgbox(1,"22333","3434")
    Endif
    WEnd

Share this post


Link to post
Share on other sites



#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form2 = GUICreate("Autoit Program Test", 200, 200, 180, 100)

$Label1 = GUICtrlCreateLabel("Press ESCAPE to start!", 20, 15, 120, 15)

$Label2 = GUICtrlCreateLabel("Press BACKSPACE to exit!", 20, 120, 140, 15)

$Connect = GUICtrlCreateButton("Pick Color!",20, 35, 55, 20)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

$hexColor=GUICtrlCreateInput("", 80, 60, 90, 20,$ES_READONLY)

GUICtrlCreateLabel("Color:", 20, 85)

GUICtrlCreateLabel("Color Code", 20, 60)

$MostrarColor=GUICtrlCreateLabel("", 80, 85, 90, 20,$ES_READONLY)

GUICtrlCreateLabel("Press Pause/Break to freeze color.", 0, 140 ,200, 15, $SS_CENTER)

GUICtrlSetColor(-1,0x00808080)

$popbut = GUICtrlCreateButton("Pop",20, 160, 55, 20)

GUISetState()

While 1

$msg=GUIGetMsg()

Select

Case $msg=$GUI_EVENT_CLOSE

exit

case $msg=$popbut

MsgBox(0,"","")

EndSelect

WEnd

while 1

$msg = GUIGetMsg()

if $msg = $popbut then

msgbox(1,"22333","3434")

Endif

WEnd


" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Share this post


Link to post
Share on other sites

Thanks I got it to work with that.

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  
Followers 0