怎样自定义 最大化, 最小化,消息?
解决方案 »
- cxgrid 焦点单元格的4维属性rect
- 新界面,让我怀念旧界面~~万恶的新界面,让我很不爽~~
- delphi7 里打开带密码的access数据库时出现工作组信息文件丢失信息,请高手指点?
- 如何使2个Combobox想关联起来,急....
- TbsSkinXFormButton,TbsSkinButton,TbsSkinSpeedButton的使用问题
- 各位大虾,关于timer组件监视数据库的问题!!!请高手们帮帮小弟啊!!见人有分啊!!
- 关于字符串的处理!急
- 今天心情非常非常不好!!散分……【三】
- 在InterWeb中如何创建第二个表单,请高手帮忙。
- dbgrideh控件的问题!
- delphi中的unit名字怎么改???
- 我要做个最简单的打印!!求救!
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin
case Message.CmdType of
SC_MAXIMIZE: ShowMessage('最大化');
SC_MINIMIZE: ShowMessage('最小化');
end;
inherited;
end;end.
begin
with Message do
begin
if (CmdType and $FFF0 = SC_MINIMIZE) and (Application.MainForm = Self) then
Application.WndProc(TMessage(Message))//就是这里,明白?
else if (CmdType and $FFF0 <> SC_MOVE) or (csDesigning in ComponentState) or
(Align = alNone) or (WindowState = wsMinimized) then
inherited;
if ((CmdType and $FFF0 = SC_MINIMIZE) or (CmdType and $FFF0 = SC_RESTORE)) and
not (csDesigning in ComponentState) and (Align <> alNone) then
RequestAlign;
end;
end;如果不是MainForm,它们之间没关系