Re: MDI Min Max - still there

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I think this may be what Im looking for.

I tried to put
Me.WindowState = FormWindowState.Maximized

in the minimize / restore events, but it doesnt do anything.
The debug writemessages work,
If I put it in the Maximize section, the parent gets maximized too.

When the child first form gets created it doesnt open in maximize.

I know this has to be close to what im looking for.

Have you used this?

Thanks.

Miro

"rowe_newsgroups" <rowe_email@xxxxxxxxx> wrote in message
news:1159886174.239890.321310@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I almost need an event that is like "on restore", "on minimize".
I looked but couldnt find one, but I guess I could live with the buttons,
as
long as I would somehow be able to put code in there to 'do nothing'.

Here's a post from Herfried a while back that may help:

------------------------------------------------------

Is there a way I can get into a form's close/minimize/maximize events
when
those buttons (the 3 small squared button in the upper right corner of a
form) are clicked?

\\\
Private Const WM_SYSCOMMAND As Int32 = &H112

Private Const SC_MAXIMIZE As Int32 = &HF030
Private Const SC_MINIMIZE As Int32 = &HF020
Private Const SC_RESTORE As Int32 = &HF120
Private Const SC_CLOSE As Int32 = &HF060

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
Select Case m.WParam.ToInt32()
Case SC_MAXIMIZE
Debug.WriteLine("Form gets maximized.")
Case SC_MINIMIZE
Debug.WriteLine("Form gets minimized.")
Case SC_RESTORE
Debug.WriteLine("Form gets restored.")
Case SC_CLOSE
Debug.WriteLine("Form gets closed.")
End Select
End If
MyBase.WndProc(m)
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Miro wrote:
Tried that, and gave up. :-)

It gets too complicated to manage, and at that point I am coding to make
the
window look pretty than actually trying to code the real code needed
instead.

Basically think of a form with a Panel docked left, and a Panel docked
Top.
In the Top panel is a toolbar - Docked to Top. The Top panel is there so
the Toolbar gets the panels background color.

Now since the left panel ( a side menu ) has a splitter so the user can
adjust it, the space where the new mdi child form can be displayed is
constantly changed. By just setting a maximized state, I accomplish one
other headache i dont want to run into, and that is if the user has a
different resolution, the mdi form in Maximized state will show nice
scrollbars, no titles.

After some more tests I had to remove the Form_SizeChanged event because
if
the user manually changes the Form1 window size, and if they have
multiple
mdi forms open within, its just super disgusting what happens. So im
back
to allowing the user to minimize it, and maximize it, and hopefuly ill
find
a solution later.

I almost need an event that is like "on restore", "on minimize".
I looked but couldnt find one, but I guess I could live with the buttons,
as
long as I would somehow be able to put code in there to 'do nothing'.

Thats why i was wonding if anyone else ever tried designing a window
interface like this and ran into this similar problem.
-You almost get the same effect like an Outlook Express, where you have
toolbar on top, left, and your "forms" display in the right mid portion
of
the screen.
-Having mdi forms makes it easy to develop new screens instead of using
panels or tab pages or other.

Was a good idea though. Thats what someone else suggested on one of the
google posts.
-Even changing the form to fixed dialog doesnt do the trick. The buttons
will always appear.

Miro



"rowe_newsgroups" <rowe_email@xxxxxxxxx> wrote in message
news:1159883123.594712.139790@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Instead of using windowstate = maximized, could you set the window
state to normal, form border style to none, and then size the child
form to the client area of the mdi form? This would give the impression
of a maximized child, but you would lose the child's title bar.

Hope that made sense,

Seth Rowe

Miro wrote:
Currently what I do is on the

Form_SizeChanged i have this code
Me.WindowState = FormWindowState.Maximized

That prevents the window from being minimized or restored, but I would
prefer to see if there is a way to get rid of the buttons all
together.

Miro


"Miro" <mironagy@xxxxxxxxxx> wrote in message
news:e%23q8ZXo5GHA.4116@xxxxxxxxxxxxxxxxxxxxxxx
I tried to set up / program a simillar setup like Quickbooks uses.
I really like the setup they created.

A toolbar docked on top,
a panel docked on left with a splitter on left.
That leaves the mdi forms opening in the right portion of the form.

And as you open the windows, they are fully maximized, and a
"window"
item
gets added to an "open window" listbox in the
left. I only allow one instance of the window to be opend.
Otherwise
i
bring it to front.

All gets goofed up when someone clicks the minimize button.

Miro

"rowe_newsgroups" <rowe_email@xxxxxxxxx> wrote in message
news:1159823098.916551.166770@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Could you override WndProc method to trap the minimize / restore
down
messages?

Also, how does your app handle multiple child forms if you can't
minimize any of them?

Thanks,

Seth Rowe

Miro wrote:
I created an MDI form and made a child form.

On the child form I set the Min / Maximize buttons to false.

However when the child form displays, the minimize button and the
"restore"
button show.
By clicking the restore button, the child moves back to its design
size,
and
then you can no longer
maximize it cause then it respects teh min/max false.

Has anyone else run into this / solution?

Ive googled and I found some "try" solution that say try to make
it a
fixed
dialog box with Control = false but taht didnt work for me either.

Im trying to create an mdi child form that will always be
maximized
and
can
never be minimized / whatever by the user.

Miro







.



Relevant Pages

  • Re: MDI Min Max - still there
    ... Basically think of a form with a Panel docked left, ... the space where the new mdi child form can be displayed is ... the user manually changes the Form1 window size, ... On the child form I set the Min / Maximize buttons to false. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: MDI Min Max - still there - solved
    ... When the child first form gets created it doesnt open in maximize. ... window look pretty than actually trying to code the real code needed ... Basically think of a form with a Panel docked left, ... the space where the new mdi child form can be displayed is ...
    (microsoft.public.dotnet.languages.vb)
  • Re: MDI Min Max - still there
    ... Why not just put "Exit Sub" in the restore and minimize Cases? ... When the child first form gets created it doesnt open in maximize. ... window look pretty than actually trying to code the real code needed ... Basically think of a form with a Panel docked left, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Anybody did some magic with Windows MDI in VCL?
    ... Your QC report could be very usable in my quest, I'd have to add a one mdichild per mdiclient limitation and create a new client for each new new child. ... Child would appear as a separate application with the MDI ... document is its own window, it is not a child of a MainForm. ... window runs its own MDI client area independantly of the other document ...
    (borland.public.delphi.thirdpartytools.general)
  • RE: How to host HTML Help Viewer in MDI child form?
    ... > to display the CHM file window as a Child window of your MDI parent window. ... > static extern int SetWindowLong; ...
    (microsoft.public.dotnet.framework.windowsforms)