unit Unit2;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls, ExtCtrls;type
TForm2 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Label3: TLabel;
RadioGroup1: TRadioGroup;
Edit3: TEdit;
Button1: TButton;
Button2: TButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
procedure FormClick(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form2: TForm2;implementation{$R *.dfm}
uses unit3;
procedure TForm2.FormClick(Sender: TObject);
begin
edit1.Visible :=True;
end;procedure TForm2.Button2Click(Sender: TObject);
begin
Close ;
end;procedure TForm2.Button1Click(Sender: TObject);
var TinfoDlg:TTinfoDlg;
j:integer;
tint:integer;
begin if length(edit1.Text )=0 then
MessageDlg('姓名不能为空!',mtError,[mbok],0)
//else if ??? then //定义Edit1.text只能为字符
//MessageDlg('姓名不能为数字!',mtError,[mbok],0)
else
begin
if length(edit2.Text )=0 then
MessageDlg('年龄不能为空!',mtError,[mbok],0) //定义Edit1.text只能为数字
else
begin
if length(edit3.Text )=0 then
MessageDlg('工作不能为空!',mtError,[mbok],0)
else
begin
TinfoDlg:=TTinfoDlg.Create(Application);
begin
if RadioButton1.Checked then
TinfoDlg.Memo1.Lines.Text :=edit1.Text +'你的年龄是'+edit2.Text
+'工作是'+edit3.Text +'性别是'+(radiobutton1.Caption )
else if RadioButton2.Checked then
TinfoDlg.Memo1.Lines.Text :=edit1.Text +'你的年龄是'+edit2.Text
+'工作是'+edit3.Text +'性别是'+(radiobutton2.Caption )
else
TinfoDlg.Memo1.Lines.Text :=edit1.Text +'你的年龄是'+edit2.Text
+'工作是'+edit3.Text +'性别是'+(radiobutton3.Caption )
end;
TinfoDlg.ShowModal;
end;
end;
end;
end;end.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls, ExtCtrls;type
TForm2 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Label3: TLabel;
RadioGroup1: TRadioGroup;
Edit3: TEdit;
Button1: TButton;
Button2: TButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
procedure FormClick(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form2: TForm2;implementation{$R *.dfm}
uses unit3;
procedure TForm2.FormClick(Sender: TObject);
begin
edit1.Visible :=True;
end;procedure TForm2.Button2Click(Sender: TObject);
begin
Close ;
end;procedure TForm2.Button1Click(Sender: TObject);
var TinfoDlg:TTinfoDlg;
j:integer;
tint:integer;
begin if length(edit1.Text )=0 then
MessageDlg('姓名不能为空!',mtError,[mbok],0)
//else if ??? then //定义Edit1.text只能为字符
//MessageDlg('姓名不能为数字!',mtError,[mbok],0)
else
begin
if length(edit2.Text )=0 then
MessageDlg('年龄不能为空!',mtError,[mbok],0) //定义Edit1.text只能为数字
else
begin
if length(edit3.Text )=0 then
MessageDlg('工作不能为空!',mtError,[mbok],0)
else
begin
TinfoDlg:=TTinfoDlg.Create(Application);
begin
if RadioButton1.Checked then
TinfoDlg.Memo1.Lines.Text :=edit1.Text +'你的年龄是'+edit2.Text
+'工作是'+edit3.Text +'性别是'+(radiobutton1.Caption )
else if RadioButton2.Checked then
TinfoDlg.Memo1.Lines.Text :=edit1.Text +'你的年龄是'+edit2.Text
+'工作是'+edit3.Text +'性别是'+(radiobutton2.Caption )
else
TinfoDlg.Memo1.Lines.Text :=edit1.Text +'你的年龄是'+edit2.Text
+'工作是'+edit3.Text +'性别是'+(radiobutton3.Caption )
end;
TinfoDlg.ShowModal;
end;
end;
end;
end;end.
解决方案 »
- 谁搞过RPC服务器的开发,请教一下。
- 程序使用excelapplication,excelworkbook,excelworksheet组件后,如果你想打开一个EXCEL文件只能看到标题?
- ADO主从表删除的问题
- 一个现实中的算法问题**********急急急**********(在线等待)
- 关于用spcomm进行串口通讯的问题
- 如何在打开新的MDI子窗体时,自动关闭当前的MDI子窗体?
- 请问delphi开发者资源交流社区的网址是什么
- 在线等候,2000开发的带access程序怎么到了98运行不了了?????
- 高手请进,如何运行内存映射文件?
- 关于把jpg写入流进行网络传输的问题?
- adoConnection 与 oracle 的连接
- 我动态给SQL语句参数赋值出现找不到第二个参数B
key:=#0;
此方法也可以if not (key in['0'..'9','.',#8]) then'.':表示可以输入小数点#8是BackSpace 键