unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Button1: TButton;
Label5: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject); private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
end;procedure TForm1.Button1Click(Sender: TObject);
begin
if edit1.Text:=''
then showmessage('sadf'); '为什么这一句老报错,消息框弹不出?end;end.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Button1: TButton;
Label5: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject); private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
end;procedure TForm1.Button1Click(Sender: TObject);
begin
if edit1.Text:=''
then showmessage('sadf'); '为什么这一句老报错,消息框弹不出?end;end.
解决方案 »
- VC 翻译成DELPHI
- 问一个sql语句,个人觉得应该很简单
- 怎样将Edit的text内容写入access数据库?我用的是adoquery.
- 菜鸟问题:delphi7开发的程序在不同大小显示器上和不同分辨率下窗体和控件的大小不一样,怎样解决?谢谢!
- DELPHI中,应用程序(.EXE)怎样使用(调用).BPL?3Q
- 關於nmsmtp1發郵件得問題,我現在可以發正文,但是我卻不知道怎麼發附件,可以用該控件發附件嗎?
- Pagecontrol中做好了四个页,如何让他们的位置调换一下?
- 如何在操作float型数时,保持其精度
- 各位老大帮偶看看这段代码,谢谢,出错提示:stack overflow
- 如何发数据给电子屏显示
- ListBox中显示了数据库中某一字段的内容,删除ListBox中的项目的同时怎样删除数据库中的同一记录
- fancier(OP&&(C/C++)) 进来拿分
应该是
IF EDIT1.TEXT='' then
showmessage('sadf');
end;
end.
showmessage('error');
showmessage('nill');