
在delphi中制作一个基础的消息框程序
窗体上一个文本框,一个按钮当在文本框上输入0-100后点击按钮则弹出消息框显示1101-200则显示2小于0大于200显示错误...
窗体上一个文本框,一个按钮
当在文本框上输入0-100后点击按钮则弹出消息框显示1
101-200则显示2
小于0大于200显示错误 展开
当在文本框上输入0-100后点击按钮则弹出消息框显示1
101-200则显示2
小于0大于200显示错误 展开
1个回答
2013-12-02
展开全部
。。。
我帮你写一个吧。
procedure TForm1.Button1Click(Sender: TObject);
begin
if (StrToInt(Edit1.Text) >= 0) and (StrToInt(Edit1.Text) <= 100) then
Application.MessageBox('你输入的是大于0小于100的数!','成功',0)
else
if (StrToInt(Edit1.Text) >= 101) and (StrToInt(Edit1.Text) <= 200) then
Application.MessageBox('你输入的是大于101小于200的数!','成功',0)
else
Application.MessageBox('错误','错误',0);
end;
end.
我帮你写一个吧。
procedure TForm1.Button1Click(Sender: TObject);
begin
if (StrToInt(Edit1.Text) >= 0) and (StrToInt(Edit1.Text) <= 100) then
Application.MessageBox('你输入的是大于0小于100的数!','成功',0)
else
if (StrToInt(Edit1.Text) >= 101) and (StrToInt(Edit1.Text) <= 200) then
Application.MessageBox('你输入的是大于101小于200的数!','成功',0)
else
Application.MessageBox('错误','错误',0);
end;
end.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询