在线等,关于radiobutton应该怎样取值?
我想用radiobutton选择填写“性别”一项,radiobutton1的caption为“男”radiobutton2的caption为“女”,请问各位我该如何赋值?
table1.fieldvalues['性别']:=?
我想用radiobutton选择填写“性别”一项,radiobutton1的caption为“男”radiobutton2的caption为“女”,请问各位我该如何赋值?
table1.fieldvalues['性别']:=?
if radiobutton2.Checked then table1.fieldvalues['性别']:='女'
if radiobutton2.Checked then table1.fieldvalues['性别']:=radiobutton2.Caption
则:
if RadioButton1.Checked then
table1.fieldvalues['性别']:='男';
if RadioButton2.Checked then
table1.fieldvalues['性别']:='女';
这样的问题,你自己写个if else不就完了吗?if RadioButton1.Checked then
begin
...
end
else .......选择项比较多,你可以使用TRadioGroup控件,这个比较方便