Page 1 of 1

CreateMenu with Form Designer

Posted: Thu Sep 25, 2014 2:05 pm
by SniffTheGlove
Hello,

If I create a new form and add a menu to it via the Form Designer the following menu code is auto generated and it always uses the following command.

Code: Select all

  CreateMenu(0, WindowID(Window_0))
You have no way to alter the createmenu properties from within the forms designer as clicking on the menu in the form does not show any properties, only when you click an actual menu item.

Is there any way to avoid using 0 as the ID and use #PB_Any or a Enumeration variable?

I am only thinking out loud and wondering if using 0 will cause any ID issues later on with other gadgets (that might be auto assigned 0 ID) or other menus in other forms that will also be auto generated with 0 as the ID by the Forms Designer.

Re: CreateMenu with Form Designer

Posted: Thu Sep 25, 2014 2:16 pm
by skywalk

Re: CreateMenu with Form Designer

Posted: Thu Sep 25, 2014 3:30 pm
by SniffTheGlove
Thanks, upon reading it was that PB_Any was not avavilae for menus back in 2010, but now they are, at least to the help file for CreatMenu
CreateImageMenu()

Syntax

Result = CreateImageMenu(#Menu, WindowID [, Flags])
Description

Creates a new empty menu on the given window with support for images in the menu items.
Parameters

#Menu A number to identify the new menu. #PB_Any can be used to auto-generate this number.

WindowID The window for the new menu. It can be obtained using the WindowID() function.

Flags (optional) This can be a combination of the following values:
#PB_Menu_ModernLook: Enable gradient and modern look (only has an effect on Windows)



Return value


Re: CreateMenu with Form Designer

Posted: Thu Sep 25, 2014 4:47 pm
by ts-soft
#PB_Any is for Menu available, but there is no #PB_Any for MenuItem, so the Featurewish is legal!