怪问题,不能隐藏窗口. 我在Dll中用 showwindow(handle,sw_show);语句显示一个From,发现在from里用hide命令无法隐藏窗口了;要怎么做才能隐藏? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在dll里面执行hide命令试试呢?然后再调用dll! program Project1;uses Forms, Unit1 in 'Unit1.pas' {Form1}, Unit2 in 'Unit2.pas' {Form2};{$R *.res}begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.CreateForm(TForm2, Form2); Application.Run;end.unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementationuses unit2;{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);begin Form2.Show;end;procedure TForm1.Button2Click(Sender: TObject);begin showwindow(Form2.Handle,sw_show);end;end.unit Unit2;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, 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 hide;end;end.程序清单如上,在Form1中按button1显示Form2,一切正常,按Button2显示Form1,则不能隐藏.到底 ShowWindow 该如何用? 用VB试了一下,2条语句一样的,都能hide难道是Delphi的BUG?不是微软的东西就是麻烦啊. >>>回复人: YoYoloveMRDJ(葱) ( ) 信誉:100 2003-12-26 08:37:00 得分:0 >>> visible:=false; 也不行!!!!!!!!!!!!!!!!!!!!!!!!!!!!!没反应 procedure TForm1.Button2Click(Sender: TObject);begin showwindow(Form2.Handle,sw_hide);end;end. 如果要隐藏form1(主窗口)那就需要这样application.showmainform:=false;form1.hide;//显示form1application.showmainform:=true;form1.show; 把procedure TForm2.Button1Click(Sender: TObject);begin hide;end;中的 hide改为 ShowWindow(Handle, SW_HIDE); DragonBill(月满西星) 呵呵,那不是有效的解决办法,如果那样的话,form.show就不起作用了. ValueListEditor.findrow() 的问题 关于视图在ADoquery中的读取和视图在dbgrid中的显示? 请问多语言版本的程序是怎么样做的?简体/繁体 帮我呀,谢谢 在TWebBrowser中如何使用书签?? 小弟初学Delphi,请各位高手帮忙。 如何在运行时动态生成一个可见的控件? DBEdit的问题? 请问将string转为char用什么函数?好像delphi的联机帮助很不适合初学者用。哪有delphi函数的分类介绍? 关于QREPORT的折行问题。 帮帮忙啊,原来没有错误的,今天出错了,急人啊 我的这段update语句不报错,但是数据库也没有更新,为什么◎
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2};{$R *.res}begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.Run;
end.unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
uses
unit2;
{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
showwindow(Form2.Handle,sw_show);
end;end.unit Unit2;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, 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
hide;
end;end.程序清单如上,在Form1中按button1显示Form2,一切正常,按Button2显示Form1,则不能隐藏.到底 ShowWindow 该如何用?
难道是Delphi的BUG?
不是微软的东西就是麻烦啊.
>>> visible:=false;
也不行!!!!!!!!!!!!!!!!!!!!!!!!!!!!!没反应
begin
showwindow(Form2.Handle,sw_hide);
end;end.
application.showmainform:=false;
form1.hide;
//显示form1
application.showmainform:=true;
form1.show;
procedure TForm2.Button1Click(Sender: TObject);
begin
hide;
end;中的
hide改为
ShowWindow(Handle, SW_HIDE);
呵呵,那不是有效的解决办法,如果那样的话,form.show就不起作用了.