各位,我刚才从论坛得知将窗口还原按钮灰掉是通过选择窗口的BorderIcons属性来实现的。
现在我问两个问题:
1、我发现如果双击标题栏,窗口还是会还原,怎样避免这种情况的出现;
2、我在主窗口上设置了一个按钮,用来打开另外一个窗口,但是当此窗口弹出时,我希望它能够显示在屏幕的正中央,应该通过调整什么属性?
请指教,谢谢。
问题1,只能通过捕捉消息.
2,把第二个窗口的position属性改为poDesktopCenter.
1: BorderStyle := bsDialog;
2: position := poDesktopCenter;
procedure WMGetMINMAXINFO(var Msg: TWMGetMinMaxInfo); Message WM_GETMINMAXINFO;
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure WMGetMINMAXINFO(var Msg: TWMGetMinMaxInfo); Message WM_GETMINMAXINFO;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMGetMINMAXINFO(var Msg: TWMGetMinMaxInfo);
begin
ShowMessage(HeHe!);
end;
end.