1,105,320 Community Members

take word from text box when mouse click

Member Avatar
Newbie Poster
1 post since Dec 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]

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,

Member Avatar
Veteran Poster
1,199 posts since Aug 2007
Reputation Points: 279 [?]
Q&As Helped to Solve: 216 [?]
Skill Endorsements: 21 [?]

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!");
      // do something here with the string "text"
This article has been dead for over three months: Start a new discussion instead
Start New Discussion
View similar articles that have also been tagged: