The text box has a string property called Text which is the entered text in the text box. For example, if you name your text box myText, you can do the following in your mouse click event:
private void MouseClick(object sender, EventArgs e)
{
string text = myText.Text;
if (String.IsNullOrEmpty(text)) // check to see we actually have some text
{
throw Exception.Create("Require text!");
}
else
{
// do something here with the string "text"
}
}
darkagn
Nearly a Posting Virtuoso
1,223 posts since Aug 2007
Reputation Points: 404
Solved Threads: 211
Skill Endorsements: 15