小编YD4*_*YD4的帖子

如何在属性属性上使用条件语句IF ELSE

我想显示MyProperty1MyProperty2基于MyPropertySelected.如何使用条件语句ifelse基于MyPropertySelected?谢谢.

// [Browsable(true)
// ????? conditional statement IF ELSE in here..
// IF (MyPropertySelected) MyProperty1 will be show ELSE MyProperty2 will be show.
public bool MyPropertySelected { get; set; }

// [Browsable(true) or [Browsable(false) depending on MyPropertySelected condition.
public int MyProperty1 { get; set; }

// [Browsable(true) or [Browsable(false) depending on MyPropertySelected condition.
public int MyProperty2 { get; set; }
Run Code Online (Sandbox Code Playgroud)

c# attributes properties conditional-operator winforms

0
推荐指数
1
解决办法
9026
查看次数