Jump to content

Recommended Posts

Posted

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)

Posted

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...

Posted

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)

  • 2 years later...

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...