Overrides Sub onMouseMove

  • Thread starter Thread starter Iouri
  • Start date Start date
I

Iouri

I have added the Overrides proc onMouseMove like
Protected Overrides Sub onMouseMove(ByVal e As
System.Windows.Forms.MouseEventArgs)

...........

End Sub

This proc supposed to fire when I move the mouse. When I am moving mouse
over the form it fires. But if mouse is over any control (textbox, listbox
etc) procedure does not fire.

I need to catch mouse move over the datagrid.

What is wrong?

Thank you
 
The mouse move message doesn't go to the form when the mouse is over another
control - it goes to that control.
 
Hi Iouri
I need to catch mouse move over the datagrid.

What is wrong?
I think that you search for a very difficult solution while the events
mouseEnter and a MouseLeave from the datagrid could be sufficient.

Cor
 
I need to verride the column resizing
if I am doing like
Protected Overrides Sub onMouseMove(ByVal e As
System.Windows.Forms.MouseEventArgs)

Dim hti As DataGrid.HitTestInfo = dg.HitTest(New Point(e.X, e.Y))

If hti.Type = DataGrid.HitTestType.ColumnResize Then

Return 'no baseclass call

End If

MyBase.OnMouseMove(e)

End Sub

it does not fire because it is over control

If I am using

Private Sub dg_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles dg.MouseMove

it fires, but does not override
 
Thank you
Charlie Williams said:
If you wish to override the base functionality, you should derive from
DataGrid and override OnMouseMove. By handling the event, you are simply
being notified when the mouse is moved and nothing more.
Alternatively, you could explicitly set the width of the column if the user tries to resize it.

As an aside, I, myself, would think twice about using an app that
intentionally went out of its way to make the UI less customizable. But
that's just me...
 
Back
Top