要在一公共單元內寫打開子窗口的過程﹐該怎么寫
請各位大師指點
請各位大師指點
解决方案 »
- Delphi困惑迷茫中......
- 怎样获得本机已经设置成共享的目录名称?用什么方法可以删除共享?
- 高分请教:怎样实现TTS的中英文全文朗读?请高手给段程序!
- 菜鸟问题:如果调用自定义的消息过程?
- Delphi6.0中水晶报表的使用,急急急!!!!在线等! 帮帮小弟
- 高分求学籍管理代码~
- 从版转过来就遇到一个问题,请教!
- ===傻傻的问一个关于制作CHM帮助的问题===
- 如何定义一个新图标变量(TIcon),使他表达的是16位色?
- 我将real player自带的activex控件导入delphi,自己做了一个程序,但它必须得先安装real player后才能运行,怎样才能解除这一限制
- 请教DELPHI的帮助系统
- 你觉得女孩的年龄在哪有个坎?
// 功能: 运行模态窗体 //
// 入口参数:AForm: 窗体类实例 //
// AFormClass:窗体类 //
// AFormCaption:窗体标题 //
// 返回值: 成功 True ;失败 False //
///////////////////////////////////////////////////////////////////////////
function RunShowModal(AForm:TForm;AFormClass: TFormClass;AFormCaption:String):Boolean;
begin
Result:=false;
if not Assigned(AForm) then AForm:=nil; AForm:=AFormClass.Create(Application);
try
AForm.Caption:=AFormCaption;
AForm.ShowModal;
finally
AForm.Free;
AForm:=nil;
end;
Result:=true;
end;///////////////////////////////////////////////////////////////////////////
// 功能: 运行非模态窗体 //
// 入口参数:AForm: 窗体类实例 //
// AFormClass:窗体类 //
// Panert:容器 //
// AFormCaption:窗体标题 //
// 返回值: 成功 True ;失败 False //
///////////////////////////////////////////////////////////////////////////
function RunChildShow(AForm:TForm;AFormClass: TFormClass;Panert:TTrPanel;AFormCaption:String):Boolean;
var
i:Integer;
begin
Result:=false;
for i:=0 to Application.ComponentCount-1 do
if (Application.Components[i] is AFormClass ) then
begin
// Application.MessageBox(Pchar((PanertForm.Components[i] as AFormClass).Caption),'',0);
if (Application.Components[i] as AFormClass).Caption = AFormCaption then
begin
ShowWindow((Application.Components[i] as AFormClass).Handle,SW_RESTORE);
exit;
end;
end; if not Assigned(AForm) then
begin
AForm:=AFormClass.Create(Application);
try
AForm.Parent:=Panert;
AForm.Top:=0;
AForm.Left:=0;
AForm.Width:=Panert.Width-5;
AForm.Height:=Panert.Height-5;
AForm.Caption:=AFormCaption;
AForm.Show;
finally
end;
end ;
Result:=true;
end;
我將AForm.ShowModal; 改為AForm.Show;﹐運行是時不報錯﹐但也看不到子窗口。
為什么﹖﹖﹖