Topic: Main menu
Hi, can I insert a main menu in any form of my application? If so, how can I do it? Tks
My Visual Database → General → Main menu
Hi, can I insert a main menu in any form of my application? If so, how can I do it? Tks
hi mvd guru, I added my custom menu to a form. Is it possible to disable a menu item after selecting it? thank you
Hello.
procedure MenuClick1 (Sender: TObject);
begin
ShowMessage('Hello from MyItem1');
TMenuItem(Sender).Enabled := False;
end;
Thanks Dmitry is perfect.
I wish I could re-enable him to press a button on the form... how can I do?
Thank you
Set some name for menu item when you creating it.
MyItem1 := TMenuItem.Create (Form2);
MyItem1.AutoHotKeys := maAutomatic;
MyItem1.Caption := 'MyItem1';
MyItem1.OnClick := @MenuClick1;
MyItem1.Name := 'mniMyItem1'; //!!!
then you can find it by name
procedure Form2_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
TMenuItem(Form2.FindComponent('mniMyItem1')).Enabled := False;
end;
Thank you absolutely perfect.
Great Support Great program Dmitry
My Visual Database → General → Main menu
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi