我在窗体上建两个按钮,caption 属性分别为‘确定’,‘取消’
name 属性为 bt_ok,bt_cancel
两上edit 组件 name分别为 edi_username,edi_userpass
procedure TForm1.bt_cancelclick(sender:Tobject);
begin
form1.modalresult:=mrcancel;
form1.close;
application.terminate;
end;
procedure TForm1.bt_okclick(sender:TObject);
begin
if(edi_username.text='ybb') and(edi_userpass.text='544')then
begin
form1.hide;
form1.modalresult:=mrok;
end;
end;
请问一下按钮控件有modalresult属性,为什么把这个属性给了窗体也一样能运行。
name 属性为 bt_ok,bt_cancel
两上edit 组件 name分别为 edi_username,edi_userpass
procedure TForm1.bt_cancelclick(sender:Tobject);
begin
form1.modalresult:=mrcancel;
form1.close;
application.terminate;
end;
procedure TForm1.bt_okclick(sender:TObject);
begin
if(edi_username.text='ybb') and(edi_userpass.text='544')then
begin
form1.hide;
form1.modalresult:=mrok;
end;
end;
请问一下按钮控件有modalresult属性,为什么把这个属性给了窗体也一样能运行。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货