Click here to Skip to main content
15,898,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a textbox myontrol in myform
i want to add a property yes/no
how to add this..
Posted

1 solution

Sounds like you are looking for something like this:
public bool YesNo
{
 get
 {
   return ctrl.Text == "Yes";
 }
 set
 {
  ctrl.Text = value?"Yes":"No";
 }
]


It's also common to use a checkbox for this kind of functionality ...

Best regards
Espen Harlinn
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900