从菜单项单击显示另一个表单

时间:2014-09-05 04:25:51

标签: delphi

我是delphi的新手并且正在研究旧的delphi项目。当我点击菜单项时,我想调用另一个表单。我有以下程序。现在,我在当前表单单元中没有NotifyCloseRunFormOption值作为参数传递给另一个单元的ShowScreens(...)过程。我应该怎么做?有什么建议吗?

procedure TForm.ShowScreens(Owner: TForm;
 Device: TComponent; RunFormOption:Integer; NotifyClose: TNotifyEvent);

begin
  FUsed:=True;
  onSetupClose:=onSetupClose;
  MakeConnection(device,NotifyClose);
end;

1 个答案:

答案 0 :(得分:0)

您想在点击MenuItem后显示一个表单,对吗? 只需添加类似

的内容
procedure YourMainFormName.onClick(Sender: TObject);
begin
    YourNewFormName.Show;
end;

到TMenuItem的OnClick程序(通过Obspect Inspector -F11指定一个)

确保在“YourMainFormName”的使用部分中包含“YourNewFormName”

我希望这能解决你的问题。祝你好运。

相关问题