MDI childforms and gripping

  • Thread starter Thread starter Rudolf
  • Start date Start date
R

Rudolf

I have a problem with MID child forms which has a
statusbar of its own but the gripping part of the form
does not respond to the mouse grip actions. Only the form
border can be clicked and dragged.
In VB 6 this behaviour was correct by in VB.Net it does
not seem to work.

Any suggestions to enable child form statusbars to also
alow grip action?

Thanks

Rudolf
 
Hi Rudolf, Not sure what you are refering to. Do you have a small sample that I can look at that will allow me to see teh behavior you are refereing to?

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.




--------------------
 
I posted a sample to your email address but I'm not sure
if you got it.

I'll describe what to do to create the problem.

1. Create a new VB.Net Windows Form project.
2. Set the initial form (Form1) to be a MDI container
(IsMDIContainer = true)
3. Add a statusbar to Form1 (leave all default settings)
4. Add a second form Form2
5. Add a statusbar to Form2
6. Add some menu or button to item to open Form2 from
Form1 e.g.

Private Sub MenuItem1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MenuItem1.Click
Dim myForm2 As New Form2()
Form2.MdiParent = Me
Form2.Show()
End Sub
7. Run the application and open form2.

You'll notice that you can click and drag Form1's
statusbar to resize Form1. However, if you try to click
and drag Form2's statusbar (the bottom right gripping
area) it won't work. The only way to resize Form2 is to
select the border.

This is not the correct behaviour. In VB 6 it worked
properly so you could also resize the MDI child form with
its statusbar.

Rudolf
-----Original Message-----
Hi Rudolf, Not sure what you are refering to. Do you have
a small sample that I can look at that will allow me to
see teh behavior you are refereing to?
Want to know more? Check out the MSDN Library at
http://msdn.microsoft.com or the Microsoft Knowledge Base
at http://support.microsoft.com
Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided "AS IS", with no warranties, and
confers no rights.
 
What I observed was that I DID get the resizing arrows on the child form when I moved the mouse to the tip of the gripping area. The behavior is defintely inconsistant with the
behavior on the Parent form where I get the resizing arrows anywhere in the gripping area. Is that the behavior you are describing? It appears to be a bug, as that is the behavior of
the form without the SizerGrip and it ONLY appears to happen if the form is an MDI child... I will report this as a bug, (It is in both versions of VS.Net and I could find no reports of this
behavior previously)...

The only workaround I can suggest is to trap the Mouse position and handle the sizing yourself or reposition it to the forms default 'corner'..

Dim K As Integer

Private Sub StatusBar1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles StatusBar1.MouseMove
TextBox1.Text = e.X & " " & e.Y
If e.X > (StatusBar1.Width - 8) Then StatusBar1.Cursor = Windows.Forms.Cursors.SizeNWSE() Else StatusBar1.Cursor = Windows.Forms.Cursors.Default()
If e.Clicks = 1 And K = 0 Then K = StatusBar1.Height - e.Y

If StatusBar1.Cursor Is Windows.Forms.Cursors.SizeNWSE And e.Button = MouseButtons.Left Then
Me.Width = e.X + 8
Me.Height = (StatusBar1.Top + (e.Y - K)) + StatusBar1.Height
End If

End Sub


Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.

Get Secure!
http://www.microsoft.com/security
http://www.microsoft.com/protect


--------------------
 
Thanks,

I appreciate effort. Would there be some kind a fix at some stage for it?

Rudolf

Scot Rose said:
What I observed was that I DID get the resizing arrows on the child form
when I moved the mouse to the tip of the gripping area. The behavior is
defintely inconsistant with the
behavior on the Parent form where I get the resizing arrows anywhere in
the gripping area. Is that the behavior you are describing? It appears to be
a bug, as that is the behavior of
the form without the SizerGrip and it ONLY appears to happen if the form
is an MDI child... I will report this as a bug, (It is in both versions of
VS.Net and I could find no reports of this
behavior previously)...

The only workaround I can suggest is to trap the Mouse position and handle
the sizing yourself or reposition it to the forms default 'corner'..
Dim K As Integer

Private Sub StatusBar1_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles StatusBar1.MouseMove
TextBox1.Text = e.X & " " & e.Y
If e.X > (StatusBar1.Width - 8) Then StatusBar1.Cursor =
Windows.Forms.Cursors.SizeNWSE() Else StatusBar1.Cursor =
Windows.Forms.Cursors.Default()
If e.Clicks = 1 And K = 0 Then K = StatusBar1.Height - e.Y

If StatusBar1.Cursor Is Windows.Forms.Cursors.SizeNWSE And
e.Button = MouseButtons.Left Then
 
I would hope so, However this has managed not to be detected this long (.net 2002 and 2003) and I could find no previous calls that reflected this problem, so it may not be
considered a 'high' priority (Compared to some of the more serious bugs they are working on) however, it may also be the case that this is something easy to fix and thats why it
has been missed. Unfortunately there is not a 'timeframe' I could give you at this point.


Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.

Get Secure!
http://www.microsoft.com/security
http://www.microsoft.com/protect


--------------------
 
Back
Top