开发者

VBA to C# Value Statement

开发者 https://www.devze.com 2022-12-12 04:08 出处:网络
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 g

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

精彩评论

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