Jump to content
Sign in to follow this  
Ghost21

Button and Menu Item

Recommended Posts

Ghost21

So what I meant was:

$Button1 = GUICtrlCreateButton("Check Up", 8, 44, 145, 23, 0)

then I have

$Button1 = GUICtrlCreateMenuItem("Check Up", $Mainmenu)

The problem is that it would use the last item. As the one that works correctley. So when I'm calling

If $nMsg = $Button1 Then

< BUTTON DATA HERE >

else

endif

It of course looks for the last $Button1 entry even though it draws the first one but if I click on the first one it doesn't respond ... Is there something I'm missing ? I want if I click on either one it runs whats inside " < BUTTON DATA HERE > ".

Thanks

Share this post


Link to post
Share on other sites
Skruge

Is there something I'm missing ?

Yes, you're missing the button's control ID because you overwrote its value. Use two different variables or use event mode.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites
billthecreator

$button1 = GuiCtrlCreatButton("Check Up", 2, 2, 100, 21)
$menu1 = GUICtrlCreateMenuItem("Check Up", $Mainmenu)

While 1
$msg = GuiGetMsg()
Switch $msg
Case $button1, $menu1
;put code here
EndSwitch
WendoÝ÷ Úâ*.j·®²)àûazv®¶­sbb33c¶'WGFöãÒwV7G&Ä7&VD'WGFöâgV÷C´6V6²WgV÷C²Â"Â"ÂÂ#¢b33c¶ÖVçSÒuT7G&Ä7&VFTÖVçTFVÒgV÷C´6V6²WgV÷C²Âb33c´ÖæÖVçR ¥vÆR¢b33c¶×6rÒwVvWD×6r¤bb33c¶×6rÒb33c¶'WGFöã÷"b33c¶×6rÒb33c¶ÖVçSFVࣷWB6öFRW&P¤VæF`¥vVæ@


[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Share this post


Link to post
Share on other sites
Ghost21

ahhh thanks alot.. I thought it would be something simple and stupid of me for misssing... :D

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.