We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,235 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

take word from text box when mouse click

Hi all,

I have problem and I don't now if I can do following in C#
In text box the user will enter text when he click mouse in specific word I wont to take it to my program To handle it .

Please give me some tip,

2
Contributors
1
Reply
2 Hours
Discussion Span
1 Year Ago
Last Updated
2
Views
peace_dove
Newbie Poster
1 post since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0580 seconds using 2.65MB