tommyliu
asked on
Use programming method create actionmanager item
Dear experts,
I have a question about actionmanager. I want to use programming method the create actionmanager->action bar-> item. Is it possible to do it? If you can, would you give me a sample for it. Thanks alot.
Tommy
I have a question about actionmanager. I want to use programming method the create actionmanager->action bar-> item. Is it possible to do it? If you can, would you give me a sample for it. Thanks alot.
Tommy
ASKER
Dear MikProg,
I think you answer is very near, but could you give me more hints because I am a newbie. Actually I want to create a ActionMainMenuBar. Thanks for you help !
Tommy
I think you answer is very near, but could you give me more hints because I am a newbie. Actually I want to create a ActionMainMenuBar. Thanks for you help !
Tommy
Replace ActionToolBar1 with ActionMainMenuBar1 ... voila! you have menu with absolutely same stuff.
ASKER
Dear MikProg,
I cannot show any menu item could you help me more ???
thanks
Tommy
I cannot show any menu item could you help me more ???
thanks
Tommy
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, XPStyleActnCtrls, ActnList, ActnMan, ToolWin, ActnCtrls;
type
TForm1 = class(TForm)
ActionManager1: TActionManager;
ActionToolBar1: TActionToolBar;
procedure FormCreate(Sender: TObject);
procedure YouActionExecCodeprocedure
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
with ActionManager1.ActionBars.
begin
ActionBar:=ActionToolBar1;
with Items.Add do
begin
Action:=TAction.Create(Act
with Action do
begin
Caption:='Get It!';
Visible:=True;
OnExecute:=YouActionExecCo
end;
end;
end;
ActionToolBar1.RecreateCon
end;
procedure TForm1.YouActionExecCodepr
begin
//
end;
end.