Hallo nano,
ich verwende eine Action "FullScreenAction" und ein MenuItem "miFullScreen".
Delphi-Quellcode:
object DemoForm: TDemoForm
...
object MainMenu: TMainMenu
Left = 60
Top = 92
object ViewMenu: TMenuItem
Caption = '&Ansicht'
object miFullScreen: TMenuItem
Action = FullScreenAction
end
end
end
object ActionList: TActionList
Left = 128
Top = 52
object FullScreenAction: TAction
Caption = '&FullScreen'
ShortCut = 32781
OnExecute = FullScreenActionExecute
end
end
end
Der ShortCut ist selbstredend Alt+Enter. Das ist mein Code:
Delphi-Quellcode:
type
TDemoForm = class(TForm)
MainMenu: TMainMenu;
ViewMenu: TMenuItem;
miFullScreen: TMenuItem;
ActionList: TActionList;
FullScreenAction: TAction;
procedure FullScreenActionExecute(Sender: TObject);
end;
implementation
procedure TDemoForm.FullScreenActionExecute(Sender: TObject);
begin
with FullScreenAction do
begin
Checked := not Checked;
SetFullScreenMode(Checked);
end;
end;
Funktioniert bei mir. Was machst du anders?
marabu