cueclub Posted April 14, 2010 Posted April 14, 2010 Can you change the Font, or color of a Menu Item? $Menu = GUICtrlCreateMenu("&Menu") $MenuItem = GUICtrlCreateMenuItem("Test Menu Item", $Menu) In the above example, the menu item would be assigned, And after it was assigned it would be given a color or shown in italic. Not sure exactly how to do it, And I may have missed it searching the forums. Any help will be appreciated. Cue
jebus495 Posted April 14, 2010 Posted April 14, 2010 GUICtrlSetFont(-1, "", 2) Adding that should work.
cueclub Posted April 14, 2010 Author Posted April 14, 2010 ok I was going to try that But not sure if it would work like that. I will give it a try and re-post if there is a problem. Thanks
cueclub Posted April 14, 2010 Author Posted April 14, 2010 yup that didnt seem to work. Any other Ideas? Or who would I go about disabling the item once it has happened, So it can no longer be pressed. Maybe that would be a better way to go. Thanks in advance
jebus495 Posted April 14, 2010 Posted April 14, 2010 ooooh now I'm pretty sure I can help there lol. _GUICtrlMenu_EnableMenuItem enable/disable(grey out)
cueclub Posted April 14, 2010 Author Posted April 14, 2010 Okay I ran into a problem with the #include <guimenu.au3> I keep getting this error C:\Program Files\AutoIt3\Include\GUIMenu.au3 (556) : ==> Variable used without being declared.: If $fByPos Then $iByPos = BitOR($iByPos, $MF_BYPOSITION) If $fByPos Then $iByPos = BitOR($iByPos, ^ ERROR ->13:34:07 AutoIT3.exe ended.rc:1 And All I am trying to do is add this $Menu = GUICtrlCreateMenu("&Menu") $MenuItem = GUICtrlCreateMenuItem("Test Menu Item", $Menu) _GUICtrlMenu_enableMenuItem($menu, $menuitem, $c1 = 1, $c1a > 0) Perhaps I have it written wrong.
jebus495 Posted April 14, 2010 Posted April 14, 2010 i don't know but did you try just declaring it somewhere in your script?
cueclub Posted April 14, 2010 Author Posted April 14, 2010 When I remove the #include, I get an undefined function. Starting to think this thing doesnt like me too well. lol
jebus495 Posted April 14, 2010 Posted April 14, 2010 Oh well, look at this. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1_1 = GUICreate("Form1", 634, 448, 192, 124) $MenuItem1 = GUICtrlCreateMenu("&MenuItem1") $MenuItem2 = GUICtrlCreateMenuItem("MenuItem2", $MenuItem1) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
GEOSoft Posted April 14, 2010 Posted April 14, 2010 All you really need is GUICtrlSetStae($MenuItem, 128) or GUICtrlSetStae($MenuItem, $GUI_DISABLE) if you have #included GUIconstantsEx.au3 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!"
cueclub Posted April 14, 2010 Author Posted April 14, 2010 Thanks to you both, I will try it and let post my results.
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