Sign in to follow this  
Followers 0
mtDEW101

My button doesn't work...

9 posts in this topic

My submit button can't be pressed which means notepad wont run..what might be the problem

#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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I believe you have to disable the picture with GuiSetStateGuiCtrlSetState(-1, $GUI_DISABLE).

I did indeed mean GuiCtrlSetState Jos.

Edited by BAM5

[center]JSON Encoding UDF[/center]

Share this post


Link to post
Share on other sites

That would lead my GUI not to show up

Share this post


Link to post
Share on other sites

That would lead my GUI not to show up

No it wouldn't. It would make your picture non clickable. The pic might be stealing the focus.


[center]JSON Encoding UDF[/center]

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Have you also taken a good look at the styles, and positioning (compare to the GUI) you have set for the pic?

Edited 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!"

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 by mtDEW101

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