Jump to content
Sign in to follow this  
Andy007

Contextmenu Icons?

Recommended Posts

Andy007

Hi All,

I have created a context menu and noticed that there are placeholders for icons...

How would one go about either setting the icon to something or removing the icon placeholder altogether?

Any help is appreciated.


Regards,Andy (no, the other one)

Share this post


Link to post
Share on other sites
rover

Hi All,

I have created a context menu and noticed that there are placeholders for icons...

How would one go about either setting the icon to something or removing the icon placeholder altogether?

Any help is appreciated.

@Andy007

Rasim answered with one of my recommendations :P

here's the other.

to remove the reserved space:

from help file GuiMenu Management section

_GUICtrlMenu_SetMenuStyle($hFile, $MNS_NOCHECK) - No space is reserved to the left of an item for a check mark

#include <GUIConstantsEx.au3>
#include <GuiMenu.au3>

Opt('MustDeclareVars', 1)

Global $filemenu, $contextmenu, $newsubmenu, $msg

;right click on gui to bring up context Menu.
GUICreate("My GUI Context Menu", 300, 200)

$filemenu = GUICtrlCreateMenu("&File")
_GUICtrlMenu_SetMenuStyle(GUICtrlGetHandle($filemenu), $MNS_NOCHECK)
GUICtrlCreateMenuItem("Open", $filemenu)
GUICtrlCreateMenuItem("Save", $filemenu)
GUICtrlCreateMenuItem("Exit", $filemenu)

$contextmenu = GUICtrlCreateContextMenu()
_GUICtrlMenu_SetMenuStyle(GUICtrlGetHandle($contextmenu), $MNS_NOCHECK)
GUICtrlCreateMenuItem("Open", $contextmenu)
GUICtrlCreateMenuItem("Save", $contextmenu)
GUICtrlCreateMenuItem("Exit", $contextmenu)

GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()
Exit

I see fascists...

Share this post


Link to post
Share on other sites
Andy007

Thanks rasim.

Thanks rover - the example was great. I know it would have taken me ages to find that.


Regards,Andy (no, the other one)

Share this post


Link to post
Share on other sites
Deito

Hi.

Whow apply _GUICtrlMenu_SetMenuStyle($hFile, $MNS_NOCHECK) for a traymenu?

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.