Aces Posted June 11, 2007 Posted June 11, 2007 #include <GUIConstants.au3>Opt("GUIOnEventMode", 1)GUICreate("Aces GUI", 300, 400)GUICtrlCreateLabel("This is Aces amateur autoit v3 GUI", 30, 10)$GUIButton = GUICtrlCreateButton("Click it!", 30, 30)GUICtrlSetOnEvent($GUIButton, "button")GUISetState(@SW_Show)Sleep(5000)Func button() MsgBox(0, "Aces Button", "Yay you clicked the button!")EndFuncI want the box to stay open, it automatically closes after the sleep time.How do I keep it open until I close it myself? ~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public
poisonkiller Posted June 11, 2007 Posted June 11, 2007 (edited) EDIT: Look below for Manadar's solution, I didn't see GUIOnEventOption. Edited June 11, 2007 by poisonkiller
jvanegmond Posted June 11, 2007 Posted June 11, 2007 I am assuming you have a good reason for using the event mode. Otherwise, you should consider doing it the default way. #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) GUICreate("Aces GUI", 300, 400) GUICtrlCreateLabel("This is Aces amateur autoit v3 GUI", 30, 10) $GUIButton = GUICtrlCreateButton("Click it!", 30, 30) GUICtrlSetOnEvent($GUIButton, "button") GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE,"Close") While 1 Sleep(500) WEnd Func button() MsgBox(0, "Aces Button", "Yay you clicked the button!") EndFunc ;==>button Func Close() Exit EndFunc github.com/jvanegmond
jvanegmond Posted June 11, 2007 Posted June 11, 2007 Replace Sleep(5000) with this: While 1 $msg = GuiGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEndHe is using event mode, and thus GUIGetMsg() does not work. github.com/jvanegmond
Aces Posted June 11, 2007 Author Posted June 11, 2007 Would using the default be simpler? and if so a little point in the right direction please? thank you guys ~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public
Aces Posted June 11, 2007 Author Posted June 11, 2007 To create a new control on an existing tabitem use GUISwitch($hWin,$tabitem) to select it and just create your new control. Don't forget to close your tabitem creation with GUICtrlCreateTabItem("").Is this how you add a GUICtrl into a tab that you have up? ~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public
jvanegmond Posted June 11, 2007 Posted June 11, 2007 Would using the default be simpler? and if so a little point in the right direction please? thank you guys#include <GUIConstants.au3> GUICreate("Aces GUI", 300, 400) GUICtrlCreateLabel("This is Aces amateur autoit v3 GUI", 30, 10) $GUIButton = GUICtrlCreateButton("Click it!", 30, 30) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUIButton MsgBox(0, "Aces Button", "Yay you clicked the button!") EndSwitch WEnd github.com/jvanegmond
jvanegmond Posted June 11, 2007 Posted June 11, 2007 Is this how you add a GUICtrl into a tab that you have up?Yes, it is. You ask your questions well. github.com/jvanegmond
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