B
Bob Dankert
I have a control which inherits from TabControl and is having some issues
with the MouseMove event being continously called when the mouse is over the
tab on the top portion. When this happens, my CPU goes to 100% utilization
and causes all sorts of issues. The odd thing about this issue is that it
only happens in some of the programs which use the control and does not
happen in others. I have tried copying the code for the windows forms code
from one working program to a non-working program to try and fix the issue
but have been unsuccessful (all properties are the exact same).
I have added some trace events to see what is causing this by adding the
following code to the MouseMove event:
Dim st As New System.Diagnostics.StackTrace
System.Diagnostics.Trace.WriteLine("On Mouse Move - Stack Trace Count: " +
st.FrameCount.ToString())
Dim i As Int16
For i = 1 To st.FrameCount
System.Diagnostics.Trace.WriteLine(st.GetFrame(i))
Next
System.Diagnostics.Trace.WriteLine("e.x: " + e.X.ToString() + " e.y: " +
e.Y.ToString() + " e.clicks: " + e.Clicks.ToString() + " e.button: " +
e.Button.ToString() + " e.delta: " + e.Delta.ToString())
With this, I get the following results. Please note that none of the mouse
parameters ever change, and I get tens or hundreds of these a second (the
whole time without touching my mouse):
e.x: 143 e.y: 9 e.clicks: 0 e.button: None e.delta: 0
On Mouse Move - Stack Trace Count: 14
WmMouseMove at offset 172 in file:line:column <filename unknown>:0:0
WndProc at offset 1588 in file:line:column <filename unknown>:0:0
WndProc at offset 399 in file:line:column <filename unknown>:0:0
WndProc at offset 380 in file:line:column <filename unknown>:0:0
OnMessage at offset 19 in file:line:column <filename unknown>:0:0
WndProc at offset 218 in file:line:column <filename unknown>:0:0
DebuggableCallback at offset 61 in file:line:column <filename unknown>:0:0
DispatchMessageW at offset 0 in file:line:column <filename unknown>:0:0
System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop
at offset 841 in file:line:column <filename unknown>:0:0
RunMessageLoopInner at offset 499 in file:line:column <filename unknown>:0:0
RunMessageLoop at offset 80 in file:line:column <filename unknown>:0:0
Run at offset 52 in file:line:column <filename unknown>:0:0
Main at offset 235 in file:line:column <filename unknown>:0:0
e.x: 143 e.y: 9 e.clicks: 0 e.button: None e.delta: 0
WmMouseMove at offset 172 in file:line:column <filename unknown>:0:0
WndProc at offset 1588 in file:line:column <filename unknown>:0:0
WndProc at offset 399 in file:line:column <filename unknown>:0:0
WndProc at offset 380 in file:line:column <filename unknown>:0:0
OnMessage at offset 19 in file:line:column <filename unknown>:0:0
WndProc at offset 218 in file:line:column <filename unknown>:0:0
DebuggableCallback at offset 61 in file:line:column <filename unknown>:0:0
DispatchMessageW at offset 0 in file:line:column <filename unknown>:0:0
System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop
at offset 841 in file:line:column <filename unknown>:0:0
RunMessageLoopInner at offset 499 in file:line:column <filename unknown>:0:0
RunMessageLoop at offset 80 in file:line:column <filename unknown>:0:0
Run at offset 52 in file:line:column <filename unknown>:0:0
Main at offset 235 in file:line:column <filename unknown>:0:0
e.x: 143 e.y: 9 e.clicks: 0 e.button: None e.delta: 0
I appreciate any help with this matter.
Thanks,
Bob Dankert
with the MouseMove event being continously called when the mouse is over the
tab on the top portion. When this happens, my CPU goes to 100% utilization
and causes all sorts of issues. The odd thing about this issue is that it
only happens in some of the programs which use the control and does not
happen in others. I have tried copying the code for the windows forms code
from one working program to a non-working program to try and fix the issue
but have been unsuccessful (all properties are the exact same).
I have added some trace events to see what is causing this by adding the
following code to the MouseMove event:
Dim st As New System.Diagnostics.StackTrace
System.Diagnostics.Trace.WriteLine("On Mouse Move - Stack Trace Count: " +
st.FrameCount.ToString())
Dim i As Int16
For i = 1 To st.FrameCount
System.Diagnostics.Trace.WriteLine(st.GetFrame(i))
Next
System.Diagnostics.Trace.WriteLine("e.x: " + e.X.ToString() + " e.y: " +
e.Y.ToString() + " e.clicks: " + e.Clicks.ToString() + " e.button: " +
e.Button.ToString() + " e.delta: " + e.Delta.ToString())
With this, I get the following results. Please note that none of the mouse
parameters ever change, and I get tens or hundreds of these a second (the
whole time without touching my mouse):
e.x: 143 e.y: 9 e.clicks: 0 e.button: None e.delta: 0
On Mouse Move - Stack Trace Count: 14
WmMouseMove at offset 172 in file:line:column <filename unknown>:0:0
WndProc at offset 1588 in file:line:column <filename unknown>:0:0
WndProc at offset 399 in file:line:column <filename unknown>:0:0
WndProc at offset 380 in file:line:column <filename unknown>:0:0
OnMessage at offset 19 in file:line:column <filename unknown>:0:0
WndProc at offset 218 in file:line:column <filename unknown>:0:0
DebuggableCallback at offset 61 in file:line:column <filename unknown>:0:0
DispatchMessageW at offset 0 in file:line:column <filename unknown>:0:0
System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop
at offset 841 in file:line:column <filename unknown>:0:0
RunMessageLoopInner at offset 499 in file:line:column <filename unknown>:0:0
RunMessageLoop at offset 80 in file:line:column <filename unknown>:0:0
Run at offset 52 in file:line:column <filename unknown>:0:0
Main at offset 235 in file:line:column <filename unknown>:0:0
e.x: 143 e.y: 9 e.clicks: 0 e.button: None e.delta: 0
WmMouseMove at offset 172 in file:line:column <filename unknown>:0:0
WndProc at offset 1588 in file:line:column <filename unknown>:0:0
WndProc at offset 399 in file:line:column <filename unknown>:0:0
WndProc at offset 380 in file:line:column <filename unknown>:0:0
OnMessage at offset 19 in file:line:column <filename unknown>:0:0
WndProc at offset 218 in file:line:column <filename unknown>:0:0
DebuggableCallback at offset 61 in file:line:column <filename unknown>:0:0
DispatchMessageW at offset 0 in file:line:column <filename unknown>:0:0
System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop
at offset 841 in file:line:column <filename unknown>:0:0
RunMessageLoopInner at offset 499 in file:line:column <filename unknown>:0:0
RunMessageLoop at offset 80 in file:line:column <filename unknown>:0:0
Run at offset 52 in file:line:column <filename unknown>:0:0
Main at offset 235 in file:line:column <filename unknown>:0:0
e.x: 143 e.y: 9 e.clicks: 0 e.button: None e.delta: 0
I appreciate any help with this matter.
Thanks,
Bob Dankert