DELPHI中 在窗体FORM1刚启动时,我在TForm1.FormCreate中加入了form1.Hide;但是没反应!!帮帮啊。为什么
我在TForm1.FormCreate中加入了form1.Hide;但是没反应!!帮帮啊。为什么为什么窗体没有隐藏啊。。。郁闷要想想窗体在启动时就隐藏我应该怎么做啊~~~...
我在TForm1.FormCreate中加入了form1.Hide;但是没反应!!帮帮啊。为什么
为什么窗体没有隐藏啊。。。郁闷
要想想窗体在启动时就隐藏我应该怎么做啊~~~~
帮帮啦,谢谢 展开
为什么窗体没有隐藏啊。。。郁闷
要想想窗体在启动时就隐藏我应该怎么做啊~~~~
帮帮啦,谢谢 展开
2个回答
展开全部
Application.ShowMainForm := False;
全部源码如下:
===========================================
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
procedure HotKeyDown(var Msg: Tmessage); message WM_HOTKEY;
public
{ Public declarations }
HotKey: Integer;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.ShowMainForm := False;
HotKey := GlobalAddAtom('MyHotKey') - $C000;
RegisterHotKey(Handle, hotkey, MOD_CONTROL, VK_F8);
end;
procedure TForm1.HotKeyDown(var Msg: Tmessage);
begin
if (Msg.LparamLo = MOD_CONTROL) AND (Msg.LParamHi = VK_F8) then
begin
form1.Visible:=true;
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnRegisterHotKey(handle, HotKey);
end;
end.
程序运行自动隐藏,ctrl+F8调出窗口
全部源码如下:
===========================================
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
procedure HotKeyDown(var Msg: Tmessage); message WM_HOTKEY;
public
{ Public declarations }
HotKey: Integer;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.ShowMainForm := False;
HotKey := GlobalAddAtom('MyHotKey') - $C000;
RegisterHotKey(Handle, hotkey, MOD_CONTROL, VK_F8);
end;
procedure TForm1.HotKeyDown(var Msg: Tmessage);
begin
if (Msg.LparamLo = MOD_CONTROL) AND (Msg.LParamHi = VK_F8) then
begin
form1.Visible:=true;
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnRegisterHotKey(handle, HotKey);
end;
end.
程序运行自动隐藏,ctrl+F8调出窗口
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询