Click here to Skip to main content
15,558,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I actually want to build a windows based application in which I will put a textbox named 'Search' and then some functionalities for Searching from the database or from the page such as to find a special word or letter.Now how can I do this?
Posted
Comments
Rajesh Anuhya 10-Nov-10 1:21am    
Any Effort???

1 solution

if I understood you right, then smth like:
C#
public partial class Form1 : Form
  {
      int currentIndex = 0;
      public Form1()
      {
          InitializeComponent();
      }
      private void Form1_Load(object sender, EventArgs e)
      {
          this.textBox2.Text = File.ReadAllText(@"F:\TEMP\log.txt");
      }
      private void button2_Click(object sender, EventArgs e)
      {
          this.currentIndex = this.textBox2.Text.IndexOf(this.textBox1.Text, currentIndex+1);
          this.textBox2.Select(this.currentIndex, this.textBox1.Text.Length);
          this.textBox2.Focus();
      }
  }
 
Share this answer
 
Comments
kibria06cse 10-Nov-10 7:43am    
Thanks a lot for your help
Heinzzy 10-Nov-10 18:47pm    
Mark your question as solved.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900