Sign in to follow this  
Followers 0
cueclub

Menu Options

12 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

ooooh now I'm pretty sure I can help there lol.

_GUICtrlMenu_EnableMenuItem

enable/disable(grey out)

Share this post


Link to post
Share on other sites

lol thanks I will give it a try

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

i don't know but did you try just declaring it somewhere in your script?

Share this post


Link to post
Share on other sites

When I remove the #include, I get an undefined function. Starting to think this thing doesnt like me too well. lol

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!"

Share this post


Link to post
Share on other sites

Thanks to you both, I will try it and let post my results.

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