Search : in
By :

If-Else statement in C#

Last answer on Feb 19, 2009 10:27:20 am GMT Digvijaysinh, on Feb 13, 2009 10:06:30 am GMT 
 Report this message to moderators

Hello,
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.

Configuration: Windows XP
Firefox 3.1

Best answers for « If Else statement in C# » in :
[C language]Checking whether an integer is a prime number Show[C language]Checking whether an integer is a prime number Definition of a prime number Algorithm 1: dividers between 2 and N-1 will be tested Algorithm 2: Even dividers will not be tested, research is limited to odd dividers Algorithm 3:...
Excel - Using IF statement to add 1 to total ShowExcel - Using IF statement to add 1 to total Issue Solution Note Issue I am trying to get a formula to add + 1 to a total cell based on the word typed. Example : If I type the word Duty in cells B3:B18 then add + 1 to cell B35. If...
[Myth] aMSN allows you to know if someone has blocked you on WLM ShowaMSN allows you to know if someone has blocked you on Windows Live Messenger Myth Reality Explanations Myth aMSN software allows us to know who blocked us on Windows Live Messenger. Reality FALSE Explanations When it was launched,...
S-video (Y/C) ShowThe S-Video standard The S-Video standard (for "Sony Video"), sometimes called Y/C, is a video transmission mode with separate components using different cables to carry information regarding luminance (luminosity) and chrominance (colour). An S...
Spreadsheets - Conditional expressions ShowWhat is a Conditional Structure? Conditional structures are instructions that allow to test if a condition is true or not. Conditional structures may be associated together. To successfully execute these tests using logical functions, spreadsheets...

1

kelvinkel, on Feb 15, 2009 9:16:53 am GMT
  • +1

Check out here put your query here and search
http://technologysearchengine.org/

Reply to kelvinkel

2

 fogsurfer, on Feb 19, 2009 10:27:20 am GMT
  • +1

//suppose you named the textbox textBox1


//This is should be the Leave event handler for the textbox
private void textBox1_Leave(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
MessageBox.Show("Tell them that they should not leave the textbox emty");
textBox1.Focus(); //this will prenvet them from leaving the textbox as long as it es empty
}
}

Reply to fogsurfer