开发者

VBA to C# Value Statement

In VBA I indicate:

If Option1.Value Then
  开发者_运维百科  TextTo= "Meters"
End If

How can I use (.Value) in C#?


I'm not sure what type of object Option1 is. My guess is that it's a RadioButton. To get the value of a RadioButton (if it's checked or not), try:

bool isChecked = yourRadionButton.Checked;

isChecked will be true if yourRadionButton is checked.

So your code might look like:

if (yourRadionButton.Checked) {
   TextTo = "Meters";
}

If this doesn't help, please clarify.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜