Jump to content

Button and Menu Item


Recommended Posts

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

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

$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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...