MouseEvent on Form

C

Colin McGuire

Hi again - just another difficult question from me.

If I have a form with the following code in it:

Private Sub MouseUp(ByVal sender As Object,
ByVal e As System.Windows.Forms.MouseEventArgs)
Handles MyBase.MouseUp
MsgBox "MouseUp"
End Sub


I see a dialog box appearing with the content "MouseUp" in it upon
mouse button release. But if the mouse is released over the forms
border, the message box doesn't appear. If there a way to catch this
event, make the form border appear as though it were the form insides?

Thank you again
Colin
 
A

Armin Zingler

Colin McGuire said:
Hi again - just another difficult question from me.

If I have a form with the following code in it:

Private Sub MouseUp(ByVal sender As Object,
ByVal e As System.Windows.Forms.MouseEventArgs)
Handles MyBase.MouseUp
MsgBox "MouseUp"
End Sub


I see a dialog box appearing with the content "MouseUp" in it upon
mouse button release. But if the mouse is released over the forms
border, the message box doesn't appear. If there a way to catch
this event, make the form border appear as though it were the form
insides?

I can not reproduce this (Framework 1.1 on WinXP). I get the event no matter
whether the cursor is over the client area of the Form, over the border or
outside the Form.
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (Colin McGuire) scripsit:
Hi again - just another difficult question from me.

If I have a form with the following code in it:

Private Sub MouseUp(ByVal sender As Object,
ByVal e As System.Windows.Forms.MouseEventArgs)
Handles MyBase.MouseUp
MsgBox "MouseUp"
End Sub


I see a dialog box appearing with the content "MouseUp" in it upon
mouse button release. But if the mouse is released over the forms
border, the message box doesn't appear. If there a way to catch this
event, make the form border appear as though it were the form insides?

<http://www.mvps.org/dotnet/dotnet/samples/codingtechnique/downloads/Subclassing.zip>

Watch for 'Private Const WM_NCLBUTTONUP As Int32 = &HA2'.
 

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