如何使窗体右上角的的"X"按扭变成灰色?即不可用 如何使窗体右上角的的"X"按扭变成灰色?即不可用 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure TForm1.FormCreate(Sender: TObject);begin EnableMenuItem(GetSystemMenu(Handle, False), SC_CLOSE, MF_GRAYED);end; unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button2: TButton; procedure Button2Click(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button2Click(Sender: TObject);var SysMenu: HMENU; begin SysMenu := GetSystemMenu(Handle, False); EnableMenuItem(SysMenu, SC_Close, MF_GRAYED); end;procedure TForm1.Button1Click(Sender: TObject);var SysMenu: HMENU; begin SysMenu := GetSystemMenu(Handle, false); EnableMenuItem(SysMenu, SC_Close, MF_GRAYED); end;end. 变成灰色我不知道怎么做,但有另外一种方法当你点击"x"按钮时window会向你发送WM_CLOSE消息,你将这个消息截获,当接受到这个消息时执行空语句。unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm) procedure CloseForm(var Message: TMessage);Message WM_CLOSE; private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.CloseForm(var Message: TMessage);begin //不执行任何操作end;end. 怎样禁止combobox控件的编辑功能,让它只能选择? 在MEMO中画当前窗口的图标,请教为什么图标闪烁很快,我觉得是在反复的PAINT,清高手赐教 求一个中文字符串加密函数~~~~ 请问怎么把.xls文件变成.db文件或者.mdb文件!!!在线等!!! 不确定数量的子数据的输入 求教,有关应用服务器端的安装问题 主细表编程时需要一个编号关联主细表,怎么设定编号? 大家讲讲实现该功能的原理 从表怎么刷新? database控件问题:真头痛!请各位大虾帮忙了! 如何在ExpressQuantumGrid中通过程序对Grid进行控制(laoniuT) 如何调试Com+程序??
begin
EnableMenuItem(GetSystemMenu(Handle, False), SC_CLOSE, MF_GRAYED);
end;
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button2: TButton;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button2Click(Sender: TObject);
var
SysMenu: HMENU;
begin
SysMenu := GetSystemMenu(Handle, False);
EnableMenuItem(SysMenu, SC_Close, MF_GRAYED);
end;procedure TForm1.Button1Click(Sender: TObject);
var
SysMenu: HMENU;
begin
SysMenu := GetSystemMenu(Handle, false);
EnableMenuItem(SysMenu, SC_Close, MF_GRAYED);
end;end.
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
procedure CloseForm(var Message: TMessage);Message WM_CLOSE;
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.CloseForm(var Message: TMessage);
begin
//不执行任何操作
end;end.