XTensionX Posted July 31, 2009 Share Posted July 31, 2009 here is mu GUI #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 334, 206, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 16, 40, 129, 49, $WS_GROUP) $Button2 = GUICtrlCreateButton("Button2", 176, 40, 145, 49, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd how can i get my button to work? want to add simple stuff like MsgBox(4096,"Test", "hello") MsgBox(4096,"Test", "Bye") in each button thanks Link to comment Share on other sites More sharing options...
BuckMaster Posted July 31, 2009 Share Posted July 31, 2009 All you do is add the case for the control #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 334, 206, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 16, 40, 129, 49, $WS_GROUP) $Button2 = GUICtrlCreateButton("Button2", 176, 40, 145, 49, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 MsgBox(4096,"Test", "hello") Case $Button2 MsgBox(4096,"Test", "Bye") EndSwitch WEnd Link to comment Share on other sites More sharing options...
XTensionX Posted July 31, 2009 Author Share Posted July 31, 2009 its working dats something new i learnt today thanks ^^ Link to comment Share on other sites More sharing options...
Hawkwing Posted August 1, 2009 Share Posted August 1, 2009 I usually prefer to set GuiOnEventMode to 1 and use GuiCtrlSetOnEvent. The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. Link to comment Share on other sites More sharing options...
CodyBarrett Posted August 1, 2009 Share Posted August 1, 2009 onevent!!! YEAH!! lol i love that... THOUGH i sometimes add Guigetmsg and setonevent 0 in certain functions to clean it up... but overall i prefer onevent [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now