Hello Everyone,
I am trying to include notes in my Main Menu (TAdvMainMenu) but is not working. Here is what I have as code
Var
MyMnuItem :TMenuItem ;
BEGIN
AdvMenuItem1.BeginUpdate ;
MyMenuItem := TMenuItem.Create(Self) ;
MyMenuItem.Caption := 'File Menu\nAllows to Manipulate files on the local hard drive\nRemote
Access is not allowed'
AdvMenuItem1.Items[0].Insert(0, MyMenuItem) ; <--------- I believe this is the problem line
since it adds a new menu item
AdvMenuItem1.EndUpdate ;
Can someone please tell me what is wrong? Also I have ShowNotes set to true
Thank you in advance
I added a default TAdvMainMenu on the form with one root item added and the code:
procedure TForm1.Button1Click(Sender: TObject);
Var
MyMnuItem :TMenuItem ;
begin
AdvMainMenu1.BeginUpdate ;
MyMnuItem := TMenuItem.Create(Self) ;
MyMnuItem.Caption := 'File Menu\nAllows to Manipulate files on the local hard drive\nRemote Access is not allowed';
AdvMainMenu1.Items[0].Insert(0, MyMnuItem) ;
AdvMainMenu1.EndUpdate ;
end;
and this correctly inserts a menu item with Notes in the first menu item under the first root item.
Hi Bruno,
Thanks for the response. Maybe I was not too clear. I have a root menu called File. Underneath it, I have several suub-menus. I was under the impression that when the mouse cursor is highlighted on File, the menu notes would appear. In fact it seems it just creates a dummy menu item, is this correct? If so, is there a way for the Menu Notes to appear at the root folder?
Thanks
Notes are additional helper lines of text that can optionally appear in a menu item under the menu item's caption text. So, the menu item height increases and text after "\n" in the caption appears as extra lines. You should see this when trying out the sample code I provided.