Overrides Sub onMouseMove

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
 
R

Robin Tucker

The mouse move message doesn't go to the form when the mouse is over another
control - it goes to that control.
 
C

Cor

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

Iouri

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
 
I

Iouri

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top