• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 620
  • Last Modified:

vb.net windows application textbox mousehover event detecting row in multirow textbox

I would like to determine which row the cursor is hovering over as it passes over a mulitrow textbox.
0
Howard Bash
Asked:
Howard Bash
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You can use code ~like~ this:



Public Class Form1
 
    Private Sub TextBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseMove
        Dim index As Integer = TextBox1.GetCharIndexFromPosition(TextBox1.PointToClient(Cursor.Position))
        Dim line As String = TextBox1.GetLineFromCharIndex(index)
        Label1.Text = TextBox1.Lines(line)
    End Sub
 
End Class

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now