How To Ideas | How To Articles | How To Tutorials


0

How To Select Some Text From A Textbox


A short help for you to select and highlight some part of the total text of a textbox. Instructions for this are as follows

Instructions:

  1. Open Visual Studio and Create a New project.
  2. In the new project, you will be having a form.
  3. Insert two textboxes onto that form.
  4. First textbox will be having a lot of text from which we select just a part of the whole text of that control which was given by second textbox.
  5. Add a button and Change its Text to “Find Text”.
  6. Double Click on the button and add the following code in button_click event.
    textBox1.Select(textBox1.Text.IndexOf(textBox2.Text), textBox2.Text.Length);
    textBox1.Focus();
  7. Run the program.
  8. Enter a line of text in first textbox and a part of that line in 2nd textbox.
  9. Hit the button and desired text got highlighted in first textbox.

Incoming search terms:

  • How select particular word select and store In length input textbox at asp net (1)
Filed in: C# Tags: , , , , , , , , , , , , ,

Leave a Reply

Submit Comment



© 9078 How To Ideas. All rights reserved.
Proudly designed by Theme Junkie.