mtDEW101 Posted October 24, 2009 Posted October 24, 2009 My submit button can't be pressed which means notepad wont run..what might be the problem expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) GUISetState(@SW_SHOW) Warcraft() Func Warcraft() Local $button Local $Form2 Local $msg Local $abs Local $plo Local $hui Local $label1 Local $pic1 Local $a Local $e Local $p $Form2 = GUICreate("tzohg[2qL] ", 566, 354, 275, 148) GUISetIcon("C:\Users\llll\Desktop\Programming\AutoIt v3\1]\Pictures\Warcraft-3-Frozen-Throne-1.ico") $abs = GUICtrlCreateInput("", 104, 168, 113, 21) $plo = GUICtrlCreateInput("", 104, 216, 113, 21) $hui = GUICtrlCreateInput("", 104, 264, 113, 21) $Pic1 = GUICtrlCreatePic("C:\Users\llll\Desktop\Programming\AutoIt v3\1]\Pictures\illidan_final.bmp", -8, 0, 593, 385, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $Label1 = GUICtrlCreateLabel("Made by tzohg[2qL]", 16, 304, 98, 17) $a = GUICtrlCreateLabel("abs", 32, 168, 44, 17) $p = GUICtrlCreateLabel("Plo", 32, 216, 50, 17) $e = GUICtrlCreateLabel("hui", 32, 264, 29, 17) $button = GUICtrlCreateButton("Submit", 128, 296, 75, 33) GUISetState() ; will display an dialog box with 2 button ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $button Run('Notepad.exe') ; Will Run/Open Notepad EndSelect WEnd EndFunc ;==>Example
BAM5 Posted October 24, 2009 Posted October 24, 2009 (edited) I believe you have to disable the picture with GuiSetStateGuiCtrlSetState(-1, $GUI_DISABLE).I did indeed mean GuiCtrlSetState Jos. Edited October 25, 2009 by BAM5 [center]JSON Encoding UDF[/center]
mtDEW101 Posted October 24, 2009 Author Posted October 24, 2009 That would lead my GUI not to show up
BAM5 Posted October 24, 2009 Posted October 24, 2009 That would lead my GUI not to show upNo it wouldn't. It would make your picture non clickable. The pic might be stealing the focus. [center]JSON Encoding UDF[/center]
Developers Jos Posted October 24, 2009 Developers Posted October 24, 2009 He probably means GUICtrlSetState{} SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
mtDEW101 Posted October 24, 2009 Author Posted October 24, 2009 Attempted that: $button = GUICtrlCreateButton("Submit", 128, 296, 75, 33) GUICtrlSetState(-1, $GUI_FOCUS) The button is focused as soon as the program is opened, but it still cannot be clicked on, which still means that notepad will not run. @BAM5 - If the pic takes the focus, then why are my input boxes able to be clicked on, while the button cannot?
Developers Jos Posted October 24, 2009 Developers Posted October 24, 2009 Have you done the GuiCtrlSetState(-1, $GUI_DISABLE) for the Image as suggested? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
GEOSoft Posted October 24, 2009 Posted October 24, 2009 (edited) Have you also taken a good look at the styles, and positioning (compare to the GUI) you have set for the pic? Edited October 24, 2009 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
mtDEW101 Posted October 24, 2009 Author Posted October 24, 2009 (edited) Fixed it. @BAM5 - Ty, I thought myself....I checked 100 times, and when I read your post about focusing, I checked it for the 101th time and rearranged the layers. Ty @Jos - Ty for telling me about GuiCtrlSetState. I tested it out, using the helpfile and learned from it. Thanks. With GuiCtrlSetState though, it only focused the button when I opened the program. Once I clicked on anything(including the button itself) the button wouldn't press. @GEOSoft - ty for the idea Edited October 24, 2009 by mtDEW101
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