how to use if-else statement for multiple condition
Expand Post »
hii
friends, i just want to know how to create if-else statement
where we dont allow user to left any textbox blank in our window application , suppose we have 3 textbox then please suggest me how to create if - else statement for this in c#.
thanx in advance.
Re: how to use if-else statement for multiple condition
Pseudocode :
if textbox1 is blank then
do something
else if texbox2 is blank then
do something
else if textbox3 is blank then
do something
else
do something
Re: how to use if-else statement for multiple condition
Typically this question comes up when you don't want the user to leave a dialog form until all of the required text boxes are populated.
If that is the case here, then do not enable the Ok button until the required textboxes are populated. To test when to enable the ok button, write a single event handler for the TextChanged event and assign it to all three textbox controls.
Re: how to use if-else statement for multiple condition
Did you get your answer or still you need some additional info? I think the answer was already been well-said here. I was supposed to add mine but I noticed the complete replies ... so I just want to ask if you are okay now or what.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.