Home > Net >  Instantiate an object, class finally in brackets, what do you mean?
Instantiate an object, class finally in brackets, what do you mean?

Time:01-10

Watch a video tutorial: an indicator light, is green when the value is 1, 0 to red, when selectedcolor SolidBrush instantiation objects, a in the brackets? , I was the first to see, the code below, or by the yellow arrow in picture, video tutorial without this feature, a warrior willing to grant instruction?


SolidBrush selectedcolor=new SolidBrush (lampstatus? TrueColor: falseColor);

CodePudding user response:

Behind a:
So it is judging a ternary operator
If lampstauts is true, then select trueColor, otherwise choose falsecolor
  •  Tags:  
  • C#
  • Related