Jump to content
Sign in to follow this  
oMBRa

my button clicks itself

Recommended Posts

oMBRa

my button keep clicking itself and this is driving me mad, here is the code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

$oIE = _IECreateEmbedded()
$GUI = GUICreate('example', 500, 500, -1, -1)
GUICtrlCreateObj($oIE, 10, 40, 400, 300)
$button = GUICtrlCreateButton('click me', 100, 400, 100, 30)
GUISetState()
_IENavigate ($oIE, "www.google.com")

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $button
            _IENavigate($oIE, 'www.google.com')
            MsgBox(0, '', '')
    EndSelect
WEnd
Edited by oMBRa

Share this post


Link to post
Share on other sites
tommeke228

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

$oIE = _IECreateEmbedded()
$GUI = GUICreate('example', 500, 500, -1, -1)
GUICtrlCreateObj($oIE, 10, 40, 400, 300)
$button = GUICtrlCreateButton('click me', 100, 400, 100, 30)
GUISetState()
_IENavigate ($oIE, "www.google.com")

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $button
            _IENavigate($oIE, 'www.google.com')
            MsgBox(0, '', '')
    EndSelect
WEnd

Edited by tommeke228

Share this post


Link to post
Share on other sites
tommeke228

you did nothing ?

include <GUIConstantsEx.au3>

->

#include <GUIConstantsEx.au3>

it can be this

Share this post


Link to post
Share on other sites
oMBRa

no it was just a typo but that's not the problem

EDIT: I solved it... stupid me

Case $button

should be

Case $nMsg = $button
Edited by oMBRa

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.