I would like the row to be highlighted when a cell is clicked in the DataGridView control.
I am using VB.NET 2005 Express Edition.
The following code was posted on a previous thread in EE, but I must be doing something wrong.
Here is my code:
==========================
==========
==========
==========
==========
==========
========
Private Sub DataGridView1_MouseUp(ByVa
l sender As Object, ByVal e As System.Windows.Forms.Mouse
EventArgs)
Handles DataGridView1.MouseUp
Dim pt = New Point(e.X, e.Y)
Dim hti As DataGrid.HitTestInfo = DataGridView1.HitTest(pt)
If hti.Type = DataGrid.HitTestType.Cell Then
DataGridView1.CurrentCell = New DataGridCell(hti.Row, hti.Column)
DataGridView1.Select(hti.R
ow)
End If
End Sub
==========================
==========
==========
==========
==========
==========
========
...and here are the errors in the Error List:
Argument not specified for parameter 'y' of 'Public Function HitTest(x As Integer, y As Integer) As System.Windows.Forms.DataG
ridView.Hi
tTestInfo'
.
Value of type 'System.Windows.Forms.Data
GridCell' cannot be converted to 'System.Windows.Forms.Data
GridViewCe
ll'.
Overload resolution failed because no accessible 'Select' accepts this number of arguments.
Does the fact that I am using VB Express 2005 have anything to do with this? Maybe I need to Import a new Namespace in code? I have many namespaces checked in Project Properties, but in code I am only importing:
Imports System.Data
Imports System.Data.OleDb
Any help would be great. Thanks!
Start Free Trial