在VBA中,我表示:
If Option1.Value Then
TextTo= "Meters"
End If
如何在C#中使用(.Value)?
发布于 2009-11-17 00:29:36
我不确定Option1
是什么类型的对象。我的猜测是这是一个RadioButton。要获取RadioButton的值(如果选中或未选中),请尝试:
bool isChecked = yourRadionButton.Checked;
如果选中yourRadionButton,则isChecked将为true。
因此,您的代码可能如下所示:
if (yourRadionButton.Checked) {
TextTo = "Meters";
}
如果这不起作用,请澄清。
https://stackoverflow.com/questions/1745793
复制相似问题