Kickassjoe Posted March 6, 2008 Share Posted March 6, 2008 I'm trying to make a contextmenu on a picture (Guictrlcreatepic()), but when I right click it, the context menu doesn't show up. I tried making a context menu on a button, and that worked, and then all I did was change the button to a picture, and it was a no-go. Am I doing something wrong, or is this not possible? What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
BrettF Posted March 6, 2008 Share Posted March 6, 2008 Got code? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
smashly Posted March 6, 2008 Share Posted March 6, 2008 Works for me..$Gui = GUICreate(":-)", 120, 58) $Pic = GUICtrlCreatePic(@WindowsDir & "\Blue Lace 16.bmp", 5, 5, 48, 48) $Context0 = GUICtrlCreateContextMenu($Pic) $Context1 = GUICtrlCreateMenuitem("Exit", $Context0) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $Context1 Exit EndSwitch WEnd Cheers Link to comment Share on other sites More sharing options...
GEOSoft Posted March 6, 2008 Share Posted March 6, 2008 Do you by any chance have the Pic control state set to disabled? 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!" Link to comment Share on other sites More sharing options...
LIMITER Posted March 6, 2008 Share Posted March 6, 2008 smashly's example works for me too Link to comment Share on other sites More sharing options...
Kickassjoe Posted March 6, 2008 Author Share Posted March 6, 2008 (edited) OHHHH... Forgot to mention that the picture is on a tab / TabItem and on top of another picture. When I put a picture off of the tab / tabitem, it works, when it is on the tabitem, it doesnt. EDIT: @Bert: Yes, but it's messy and long, and uses an .ini and a lot of pics, don't want to release it right now. Edited March 6, 2008 by Kickassjoe What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
BrettF Posted March 6, 2008 Share Posted March 6, 2008 OHHHH... Forgot to mention that the picture is on a tab / TabItem and on top of another picture. When I put a picture off of the tab / tabitem, it works, when it is on the tabitem, it doesnt.EDIT:@Bert: Yes, but it's messy and long, and uses an .ini and a lot of pics, don't want to release it right now.Create something that repoduces your enviroment... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Kickassjoe Posted March 7, 2008 Author Share Posted March 7, 2008 (edited) It was the picture below the picture causing the problem, as seen here. $Gui = GUICreate(":-)", 120, 58) $Pic1 = GUICtrlCreatePic(@WindowsDir & "\Blue Lace 16.bmp", 5, 5, 70, 70) $Context0 = GUICtrlCreateContextMenu($Pic1) $Context1 = GUICtrlCreateMenuitem("Exit", $Context0) $Pic2 = GUICtrlCreatePic(@WindowsDir & "\Greenstone.bmp", 20, 20, 40, 40) $Context0 = GUICtrlCreateContextMenu($Pic2) $Context1 = GUICtrlCreateMenuitem("doesnt show up", $Context0) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $Context1 Exit EndSwitch WEnd Edit: and no, I don't want to get rid of the bottom pic to solve that, if possible Edited March 7, 2008 by Kickassjoe What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
Kickassjoe Posted March 7, 2008 Author Share Posted March 7, 2008 Got it, GuiCtrlSetState(-1, $GUI_DISABLE) after the first picture worked. What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now