Sign in to follow this  
Followers 0
Spaghetti prog

Button + popup

5 posts in this topic

Basically what i want to do is to show a popup when i click on a button (sort of context menu just under the button). So I used Guicreate with WSpopup style. That is fine but i'd like to get rid of it if by click anywhere in the form or much better elsewhere ... You know like when you click on the start button, popup shows and if you change yout mind you just clik anywhere but on it

Thanks for your help


goto is evil

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You could search the forum for _ispressed and use the left click hex

Edit: Added link

Edited by killaz219

Share this post


Link to post
Share on other sites

Newest unstable allows... control-specific context menus. Here's a way to allow a context menu on left or right clicks...

$GUI = GuiCreate("ExampleGUI")
$button = GuiCtrlCreateButton("SomeButton", 100, 100, 100, 100)
$buttoncontext = GUICtrlCreateContextMenu($button)
GUICtrlCreateMenuitem("This is a context menu...",$buttoncontext)
GuiSetState()
While 1
   $msg = GuiGetMsg()
   If $msg = -3 Then
      ExitLoop
   ElseIf $msg = $button Then
      $p = MouseGetPos()
      MouseClick("right", $p[0], $p[1])
   EndIf
WEnd

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Well cyber, if he uses the ispressed, he can do a click on anywhere in the screen will close it.

But thats a good way to look at it :idiot:

Edited by killaz219

Share this post


Link to post
Share on other sites

@killaz219: thank u for the ispress stuff,I shalll use it for other purpose

@cyberslug: your solution is perfect. BTW 1000's thanks for your work on LBS wrapper. It should be incorporated in autoit since get/receivemsg seems unfortunately to be the only way to use this control porperly.


goto is evil

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