I have my main windows form which has a txtClientArea textbox where a user will input his data. So i put a Find command in menu strip which calls another form frmFindandReplace. This frmFindandReplace should find user input text in txtClientArea textbox of my main windows form. Here is what I have done so far, I have used alot of hours browsing the internet for answers but nothing! I need to find every result in txtClientArea (which should be highlighted with different backcolor) with find button and replace all with replace button.
Thank you people. i hope i can count on you.Code:Private Sub findButton_Click(sender As Object, e As EventArgs) Handles findButton.Click Dim a As String Dim b As String a = TextBoxSearch.Text b = InStr(txtClientArea.Text, TextBoxSearch.Text) If b Then txtClientArea.Focus() txtClientArea.SelectionStart = b - 1 txtClientArea.SelectionLength = Len(a) txtClientArea.ScrollToCaret()




Reply With Quote
