unknown12 Posted July 21, 2004 Posted July 21, 2004 This is probably really easy, but how do i check if a button has been pressed?
vickerps Posted July 22, 2004 Posted July 22, 2004 hope it helps Opt ("GUINotifyMode", 1) GUICreate("Select the Building:", 120, 100) $OK = GUISetControl ("button", "OK", 10,10,50,20) $Exit = GuisetControl ("button", "Exit", 10,40,50,20) While 1 $N=GuiMsg () SELECT Case $n = $OK Msgbox(0,0,"ok button has been pressed") Case $n = $Exit Msgbox(0,0,"EXIT button has been pressed") Exit EndSelect WEnd GUIHide()
Arctor Posted July 23, 2004 Posted July 23, 2004 In the latest version you need a GuiShow() before the While loop so that the Gui comes up. arctor
ioliver Posted August 5, 2004 Posted August 5, 2004 Opt ("GUINotifyMode", 1) GUICreate("Select the Building:", 120, 100) $OK = GUISetControl ("button", "OK", 10,10,50,20) $Exit = GuisetControl ("button", "Exit", 10,40,50,20) While 1 $N=GuiMsg () SELECT Case $n = $OK Msgbox(0,0,"ok button has been pressed") Case $n = $Exit Msgbox(0,0,"EXIT button has been pressed") Exit EndSelect WEnd GUIHide() When I try this $n always = '-2'. Here is my code. The MsgBox's are there for me to see what's happening... ; NetMsg.au3 ; August 5, 2004 ; A NetSend Utility GUICreate("NetMsg / A NetSend Utility", 300, 200) GUISetControl("Label", "Username:", 10, 10) $user = GUISetControl("Input", "Username", 10, 25) GUISetControl("Label", "Message:", 10, 60) $msg = GUISetControl("Input", "Type your message here", 10, 75, 280) $netsend = GUISetControl("Button", "Send", 10, 110, 100) $quit = GUISetControl("Button", "Exit", 190, 110, 100) GUIShow() GUIWaitClose() While 1 $x = GuiMsg() MsgBox(0, "$x", $x) Select Case $x = $netsend MsgBox(0, "$user", $user) MsgBox(0, "$msg", $msg) RunWait(@ComSpec & " /c " & "netsend " & $user & " " & $msg, "", @SW_HIDE) Case $x = $quit Exit EndSelect WEnd Thanks for any help, Ian "Blessed be the name of the Lord" - Job 1:21Check out Search IMF
Holger Posted August 6, 2004 Posted August 6, 2004 @ioliver:You have to use:Opt ("GUINotifyMode", 1)Or should be use:GUISetControlNotify() after setting the button controls.One of these you sould take.AND: delete the line with "GUIWaitCLose()"!!!Regards Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
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