Bug with Mdi Applications - Fixed Single Forms become Maximized

G

Guest

I have found a bug in VB.NET which is really annoying. I have devised a
workaround, but would like to know if: 1) Microsoft found and fixed this bug
in the latest release of VB.NET as I'm still using an older version; and, 2)
anyone else has found a better workaround.

The Bug: I'm creating an Mdi windows application that has many different
mdi child forms. Some of these child forms have a sizeable border style,
while others are fixed single. If you open a fixed single form while a
sizable form is opened and maximized, then the fixed single form will show up
maximized (even though the form has no maximize button, and the maximum size
properties are set to prohibit such expansion). Likewise, if you close a
sizeable form that is in maximized windowstate, and the next form to get
focus has a fixed single border style (e.g. a fixed single form that was
already opened), then that form will become maximized.

My Workaround: If I loop through the mdi children and set the windowstate
of any maximized forms to normal prior to opening a fixed single window (see
code below), then the fixed single form opens properly. That handles opening
a fixed single window; however, I still have to devise a way to handle
closing a maximized sizable form and preventing a fixed single form that
thereby obtains focus from becoming maximized.

Private Sub Set_FixedSingle_Show()
Dim Normal_Form As Form

For Each Normal_Form In Me.MdiChildren
If (Normal_Form.WindowState = FormWindowState.Maximized) Then
Normal_Form.WindowState = FormWindowState.Normal
End If
Next
End Sub
 
J

Jared

I don't like loops.

Could you try create form with no border and dock 4 panels(with size of 1)
left,right, top and bottom to replicate single border?
 

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