473,587 Members | 2,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MouseUp-Event gets 'lost'

Hi,

I have a child-form in an MDI-Application which seems to loose the MouseUp-Event.
I grid (for navigation-purpose) appears on many of the child-forms and in (I think) only one this issue occurs.

What happens:

Private Sub grdNavigation_M ouseDown(ByVal sender As System.Object, ByVal e As System.Windows. Forms.MouseEven tArgs) Handles grdNavigation.M ouseDown
Debug.WriteLine ("Down: " & e.Button.ToStri ng)
End Sub

Private Sub grdNavigation_M ouseUp(ByVal sender As System.Object, ByVal e As System.Windows. Forms.MouseEven tArgs) Handles grdNavigation.M ouseUp
Debug.WriteLine ("Up: " & e.Button.ToStri ng)
End Sub

This simple (to clarify the issue) snippet should output:
Tab - Down: Left
Tab - Up: Left
Tab - Down: Right
Tab - Up: Right
It does so for the left button, but with the right button the event happens only every 2 to 5 times.

I've hooked-up Spy++ and I can see the WM_RBUTTONUP-Message every time I release the R-Button.

I've also tried to comment-out all the code in the child-form (exept the designer-code & the mouse-up/down of course) but that makes no difference.

Any-one any clue where to 'look'.

Thanks,

Michael

PS: Just a note: the form contains a TabControl (Maybe 'another' bug?)

I'm using:
a.. vb.Net 2003 Enterprise Architect Edition
b.. Windows XP SP1a
Nov 20 '05 #1
4 1948
Hi,

What do you mean by the grid?

I can not reproduce the problem.
Here is my reproduce steps.
1. Create a new windowform project
2. Add two forms( one set IsMDIContainer to true)
3. Add a tabcontrol onto the child form and add the datagrid onto the
tabpage( I also tried add the datagird onto the form directly)
4. Add the MouseDown and MouseUp event handler

Private Sub DataGrid1_Mouse Down(ByVal sender As Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles DataGrid1.Mouse Down
Debug.WriteLine ("Down: " & e.Button.ToStri ng)
End Sub

Private Sub DataGrid1_Mouse Up(ByVal sender As Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles DataGrid1.Mouse Up
Debug.WriteLine ("Up: " & e.Button.ToStri ng)
End Sub

You may try my reproduce steps to see if the problem persists.

Also can you simplify your code and post it here for me to further
troubleshooting .

I look forward to hearing from you.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #2
I think I have to go back to school (form my english anyway)
"Michael Maes" <mi*****@merlot .com> wrote in message news:eR******** ********@TK2MSF TNGP11.phx.gbl. ..
Hi,

I have a child-form in an MDI-Application which seems to loose the MouseUp-Event.
I grid (for navigation-purpose) appears on many of the child-forms and in (I think) only one this issue occurs.
A (data)grid (for navigation-purpose) appears on many of the child-forms (of the MDI-Application) and (I think) only this one (form) has the issue.

What happens:

Private Sub grdNavigation_M ouseDown(ByVal sender As System.Object, ByVal e As System.Windows. Forms.MouseEven tArgs) Handles grdNavigation.M ouseDown
Debug.WriteLine ("Down: " & e.Button.ToStri ng)
End Sub

Private Sub grdNavigation_M ouseUp(ByVal sender As System.Object, ByVal e As System.Windows. Forms.MouseEven tArgs) Handles grdNavigation.M ouseUp
Debug.WriteLine ("Up: " & e.Button.ToStri ng)
End Sub

This simple (to clarify the issue) snippet should output:
Tab - Down: Left
Tab - Up: Left
Tab - Down: Right
Tab - Up: Right
It does so for the left button, but with the right button the event happens only every 2 to 5 times.

I've hooked-up Spy++ and I can see the WM_RBUTTONUP-Message every time I release the R-Button.

I've also tried to comment-out all the code in the child-form (exept the designer-code & the mouse-up/down of course) but that makes no difference.

Any-one any clue where to 'look'.

Thanks,

Michael

PS: Just a note: the form contains a TabControl (Maybe 'another' bug?)

I'm using:
a.. vb.Net 2003 Enterprise Architect Edition
b.. Windows XP SP1a
Nov 20 '05 #3
Hi Michael,

I am sorry if I did not ask for information properly. What I mean is what
kind of grid do you use.
Since there is two grid in winform controls (Property Grid and datagrid).
Also I think you perhaps use another grid which is created by others.

Now I have know that the problem persists with a datagrid.
And your senario is as below.
You have a few child forms and the child form have datagrid on the each
child form. One of your form did not work proper with the Right mouse
button down.

Since the problem persists in just one of your childform.
To isolate the problem I think you may try to recreate a childfrom and add
the datagrid onto the form and your codes one function by one functions see
if the problem persists.

If the problem still persists, you may try to inherits the DataGrid and
override its winproc function to see if the WM_RBUTTONDOWN and WM_RBUTTONUP
have been captured by datagrid.

Here is my code you may have a try.

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim mg As New MyGrid
Me.Controls.Add (mg)
End Sub
End Class

Public Class MyGrid
Inherits DataGrid
Public Enum MouseMessage As Integer
WM_LBUTTONDOWN = &H201
WM_LBUTTONUP = &H202
WM_RBUTTONDOWN = &H204
WM_RBUTTONUP = &H205
End Enum
Dim mm As MouseMessage
Protected Overrides Sub WndProc(ByRef m As System.Windows. Forms.Message)
mm = m.Msg
If Len(mm.ToString ()) > 5 Then
Console.WriteLi ne(mm.ToString)
End If
MyBase.WndProc( m)
End Sub
End Class
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #4
Hi Peter,

Seems like I've found the problem.

I've stripped-down the form control by control and located the problem in
the mnuEdit - contextmenu.
It was assigned to the form thus (probably) interfering with the WM.

I'dd realy like to thank you for helping me.

Kind regards,

Michael

PS: Still have to examine the "Configurin g a VPN Tunnel through vb.Net"

"Peter Huang" <v-******@online.m icrosoft.com> wrote in message
news:PZ******** ********@cpmsft ngxa06.phx.gbl. ..
| Hi Michael,
|
| I am sorry if I did not ask for information properly. What I mean is what
| kind of grid do you use.
| Since there is two grid in winform controls (Property Grid and datagrid).
| Also I think you perhaps use another grid which is created by others.
|
| Now I have know that the problem persists with a datagrid.
| And your senario is as below.
| You have a few child forms and the child form have datagrid on the each
| child form. One of your form did not work proper with the Right mouse
| button down.
|
| Since the problem persists in just one of your childform.
| To isolate the problem I think you may try to recreate a childfrom and add
| the datagrid onto the form and your codes one function by one functions
see
| if the problem persists.
|
| If the problem still persists, you may try to inherits the DataGrid and
| override its winproc function to see if the WM_RBUTTONDOWN and
WM_RBUTTONUP
| have been captured by datagrid.
|
| Here is my code you may have a try.
|
| Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
| System.EventArg s) Handles Button1.Click
| Dim mg As New MyGrid
| Me.Controls.Add (mg)
| End Sub
| End Class
|
| Public Class MyGrid
| Inherits DataGrid
| Public Enum MouseMessage As Integer
| WM_LBUTTONDOWN = &H201
| WM_LBUTTONUP = &H202
| WM_RBUTTONDOWN = &H204
| WM_RBUTTONUP = &H205
| End Enum
| Dim mm As MouseMessage
| Protected Overrides Sub WndProc(ByRef m As
System.Windows. Forms.Message)
| mm = m.Msg
| If Len(mm.ToString ()) > 5 Then
| Console.WriteLi ne(mm.ToString)
| End If
| MyBase.WndProc( m)
| End Sub
| End Class
|
|
| Best regards,
|
| Peter Huang
| Microsoft Online Partner Support
|
| Get Secure! - www.microsoft.com/security
| This posting is provided "AS IS" with no warranties, and confers no
rights.
|
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2220
by: lkrubner | last post by:
I've got a function, you can see it below, that is being called onmouseup in the textarea on my main form. The idea is to find a selection if possible and store that text in a global variable. I can't get this to work in any browser on a Mac, though it works alright on a PC. What am I missing?
2
2457
by: fnsbe | last post by:
Hi everybody, First of all I'm not a java hero but I tried to write my own text editor. Everything works but only when the existing text need to be re-edited the butttons of my editor seem not to work anymore... This is the main script : <!-- function storeCaret (txtarea) { if (txtarea.createTextRange) {
7
9227
by: Sue & Bill | last post by:
Does a double click action also generate two MouseUp events? If so, what is a good method in my MouseUp event handler to detect that a MouseUp is part of a double click action? Thanks in advance.
1
5794
by: Nathan Sokalski | last post by:
I want to create a pushbutton-like control on my webform that has an image on it. I used to think that this is what the ImageButton control was, but it seems to me that the ImageButton is nothing more than an image that can be clicked. I have figured out a way to make the ImageButton look like a button (there was some border property and the...
4
4344
by: Colin McGuire | last post by:
Hi again, thanks everyone for your previous help. But having resolved past problems, I'm moving on to new problems :( This one is a simple winforms application with two buttons, named Button1 and Button2, on it (code below). When I press the mouse button over Button2, and don't release it, in the IDE output window it prints...
0
922
by: rob willaar | last post by:
I use the treeview to open a new form but the treeview reclaims focus after MouseUp Any solutions to this problem?
1
3127
by: Udi | last post by:
Hi, I have a user control - A that has a panel that contains a list of a different user control - B. When I'm adding a new B to A, I'm subscribing a handler (which is a method of A) to B.MouseUp. However, when I click B the event is not fired. See example: class A : System.Windows.Forms.UserControl {
2
2268
mrdata
by: mrdata | last post by:
Hello all I am trying to send 2 commands to my camera, cmovert and cmovest. cmovert will start continuous movement to the right. cmovest will issue a stop command. I would like to have onmouseover and onmouseout change my img, onmousedown to issue the cmovert command and onmouseup to issue the cmovest command. In other words, I would like...
2
1909
by: =?Utf-8?B?TWFyaw==?= | last post by:
Does anyone know where there is some sample code that explains now a user; using the mouse can click on an image on the screen. Capture the image by boxing it in using the mouse and then save it to a bitmap or onto another form? Thank you -- Mark
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.