This is Visual Basic 2008:
I have an application where I have the main textbox on the main form, and the search window on a seperate form, and whenever someone clicks the mouse in the main forms text, I want the search window to detect that change so that if during a search, someone want to go back and change something, they can just click the mouse in the textbox and restart the search from that location. (So I am just trying to update the seach start location whenever someone clicks the mouse in the text.) Problem is, I don't know how to pass information from one forms code to another forms code. I have the frmMain, which has the search text and I have the frmSearch that has all the search controls on it.
Now I have to have some way to pass these two data items to the second form, and so far everything I have tried has failed. Any suggestions?
I have an application where I have the main textbox on the main form, and the search window on a seperate form, and whenever someone clicks the mouse in the main forms text, I want the search window to detect that change so that if during a search, someone want to go back and change something, they can just click the mouse in the textbox and restart the search from that location. (So I am just trying to update the seach start location whenever someone clicks the mouse in the text.) Problem is, I don't know how to pass information from one forms code to another forms code. I have the frmMain, which has the search text and I have the frmSearch that has all the search controls on it.
Code:
' Get the cursor location when someone clicks in the text box
Private Sub RichTextBox1_Click(bla bla bla) Handles RichTextBox1.Click
CursorLocNow = Me.RichTextBox1.SelectionStart
cursorLocationChanged = True
End Sub
Comment