B
bx59830
Unregistered / Unconfirmed
GUEST, unregistred user!
怪事、窗口最小化后隐藏,再显示后,不能最小化了.最小化按钮不起作用。代码如下unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls;type TForm1 = class(TForm) Timer1: TTimer;
Button2: TButton;
procedure Timer1Timer(Sender: TObject);
procedure Button2Click(Sender: TObject);
private { Private declarations } public { Public declarations } end;
var Form1: TForm1;implementationuses Unit2;{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled := False;
Form2.Show;
//显示密码确认窗口 //如果当前Form1为最小化状态,隐藏再显示后就不能最小化。 //隐藏前使用 Form1.WindowState := wsMaximized;
无效 Form1.Hide;
//隐藏主窗口end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Timer1.Enabled := True;
end;
end.
unit Unit2;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,Unit1, StdCtrls;type TForm2 = class(TForm) Button1: TButton;
procedure Button1Click(Sender: TObject);
private { Private declarations } public { Public declarations } end;
var Form2: TForm2;implementation{$R *.dfm}procedure TForm2.Button1Click(Sender: TObject);
begin
Form1.Show;
//显示主窗口 Form2.Hide;
//隐藏当前窗口 end;
end.
Button2: TButton;
procedure Timer1Timer(Sender: TObject);
procedure Button2Click(Sender: TObject);
private { Private declarations } public { Public declarations } end;
var Form1: TForm1;implementationuses Unit2;{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled := False;
Form2.Show;
//显示密码确认窗口 //如果当前Form1为最小化状态,隐藏再显示后就不能最小化。 //隐藏前使用 Form1.WindowState := wsMaximized;
无效 Form1.Hide;
//隐藏主窗口end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Timer1.Enabled := True;
end;
end.
unit Unit2;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,Unit1, StdCtrls;type TForm2 = class(TForm) Button1: TButton;
procedure Button1Click(Sender: TObject);
private { Private declarations } public { Public declarations } end;
var Form2: TForm2;implementation{$R *.dfm}procedure TForm2.Button1Click(Sender: TObject);
begin
Form1.Show;
//显示主窗口 Form2.Hide;
//隐藏当前窗口 end;
end.