摘要载入中… 请稍等…
内容载入中… 请稍等…
| ◎→ | 本类最新 |
|
DELPHI动态生成控件 Delphi编程中创建一个启动闪现窗 在win95,win98下实现半透明的窗口 拖动无标题栏窗体的方法 用Delphi 控制窗体的大小 使MDI窗口有一个背景图象或使它平 软件启动画面中启动状态的显示 |
|
| ◎→相关资源 | |
| C语言入门视频教程 C#编程WinForm入门视频 Asp.net入门视频教程下载 VC++编程视频教程下载 VB窗体文章 HTML入门教程 Deiphi实例教程 Deiphi窗体文章 Deiphi数据库编程 Deiphi网络编程 Deiphi图形图象文章 Deiphi系统文件 | |
| ◎→ | 热门资源 |
| Delphi数据压缩处理(2) Delphi数据压缩处理(1) 简析Delphi中如何进行XML编程 简析Delphi中如何进行XML编程(10 Delphi下的COM编程技术简介(2) Delphi下的COM编程技术简介(1) 用Delphi 3.0编制MP3音乐点歌台 |
|
procedure TFrmMain.ApplicationEvents1Idle(Sender: TObject;
var Done: Boolean);
var
show: boolean;
begin
//当前子窗体的状态为最大化时,显示三个按纽
show := (self.ActiveMDIChild <> nil) and (self.ActiveMDIChild.WindowState =
wsMaximized);
if assigned(BtnClose) and BtnClose.Visible <> Show then
BtnClose.Visible := Show;
if assigned(BtnMin) and BtnMin.Visible <> Show then
BtnMin.Visible := Show;
if assigned(BtnRestore) and BtnRestore.Visible <> Show then
BtnRestore.Visible := Show;
end;
//设置按纽的相对位置不变
procedure TfrmMain.SetMDIFormActionPos;
begin
if assigned(BtnClose) then
begin
BtnClose.left := Width - 26;
BtnClose.top := 6;
end;
if assigned(BtnRestore) then
begin
BtnRestore.Left := Width - 44;
BtnRestore.Top := 6;
end;
if assigned(BtnMin) then
begin
BtnMin.Left := Width - 60;
BtnMin.Top := 6;
end;
end;
procedure TFrmMain.FormResize(Sender: TObject);
begin
SetMDIFormActionPos;
end;
procedure TFrmMain.FormDestroy(Sender: TObject);
begin
//释放资源
if assigned(BtnClose) then
begin
WindowClose.ActionList := nil;
WindowClose.free;
BtnClose.Free;
BtnClose := nil;
end;
if assigned(BtnRestore) then
begin
WindowRestore.ActionList := nil;
WindowRestore.free;
BtnRestore.Free;
BtnRestore := nil;
end;
if assigned(BtnMin) then
begin
WindowMinimize.ActionList := nil;
WindowMinimize.free;
BtnMin.Free;
BtnMin := nil;
end;
end;
{ TWindowRestore }
procedure TWindowRestore.ExecuteTarget(Target: TObject);
begin
inherited;
with GetForm(Target) do
ActiveMDIChild.WindowState := wsnormal;
end;
{ TMDIButton }
procedure TMDIButton.wndproc(var message: Tmessage);
begin
if message.msg = wm_SetFocus then exit;
inherited wndproc(message);
end;
{ TWindowMinimize }
procedure TWindowMinimize.ExecuteTarget(Target: TObject);
begin
inherited;
with GetForm(Target) do
ActiveMDIChild.WindowState := wsMinimized;
end;
procedure TFrmMain.open1Click(Sender: TObject);
begin
with Tform.create(self) do
begin
formstyle := fsMDIChild;
end;
end;
end.
[1]| 芯友网版权所有 1999-2006 | 著作权与商标声明 | 法律声明 | 服务条款 | 隐私声明 | 联系我们 |