I'm working a custom datagridcolumn for my app.
It shows 6 16x16 images side by side that act like buttons when clicked (visually they don't change however). The buttons can be disabled simply by the value of the cell ("101010" - every other one is enabled).
The images show up just fine in my datagrid, and I've got the program to send Click events (6 different events with row number as parameter) for the different buttons.
I would like the cursor to change to the Hand when over an enabled button.
Right now I just want the cursor to change - whether its over an enabled button or not I can add that later (that's easy).
I've currently got the MouseMove being trapped by the column and correctly identifying whether it's in the cell or not and then the following:
What's weird is that the Cursor.Current = Cursors.Hand does run when over the correct button - but my cursor doesn't change.
Any ideas?
It shows 6 16x16 images side by side that act like buttons when clicked (visually they don't change however). The buttons can be disabled simply by the value of the cell ("101010" - every other one is enabled).
The images show up just fine in my datagrid, and I've got the program to send Click events (6 different events with row number as parameter) for the different buttons.
I would like the cursor to change to the Hand when over an enabled button.
Right now I just want the cursor to change - whether its over an enabled button or not I can add that later (that's easy).
I've currently got the MouseMove being trapped by the column and correctly identifying whether it's in the cell or not and then the following:
Code:
rect = dg.GetCellBounds(hti.Row, hti.Column)
Dim pointx As Integer = e.X - rect.X
Select Case pointx
Case 0 To 16
Cursor.Current = Cursors.Hand
Case 16 To (2 * 16)
Cursor.Current = Cursors.Hand
Case (2 * 16) To (3 * 16)
Cursor.Current = Cursors.Hand
Case (3 * 16) To (4 * 16)
Cursor.Current = Cursors.Hand
Case (4 * 16) To (5 * 16)
Cursor.Current = Cursors.Hand
Case Is > (5 * 16)
Cursor.Current = Cursors.Hand
Case Else
Cursor.Current = Cursors.Default
End Select
What's weird is that the Cursor.Current = Cursors.Hand does run when over the correct button - but my cursor doesn't change.
Any ideas?