|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
MDI Min Max - still thereOn 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 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: Show quoteHide quote > 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 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 Show quoteHide quote "rowe_newsgroups" <rowe_em***@yahoo.com> wrote in message news:1159823098.916551.166770@i3g2000cwc.googlegroups.com... > 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 > 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 Show quoteHide quote "Miro" <miron***@golden.net> wrote in message news:e%23q8ZXo5GHA.4116@TK2MSFTNGP03.phx.gbl... >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_em***@yahoo.com> wrote in message > news:1159823098.916551.166770@i3g2000cwc.googlegroups.com... >> 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 >> > > 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: Show quoteHide quote > 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" <miron***@golden.net> wrote in message > news:e%23q8ZXo5GHA.4116@TK2MSFTNGP03.phx.gbl... > >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_em***@yahoo.com> wrote in message > > news:1159823098.916551.166770@i3g2000cwc.googlegroups.com... > >> 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 > >> > > > > 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 Show quoteHide quote "rowe_newsgroups" <rowe_em***@yahoo.com> wrote in message news:1159883123.594712.139790@i3g2000cwc.googlegroups.com... > 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" <miron***@golden.net> wrote in message >> news:e%23q8ZXo5GHA.4116@TK2MSFTNGP03.phx.gbl... >> >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_em***@yahoo.com> wrote in message >> > news:1159823098.916551.166770@i3g2000cwc.googlegroups.com... >> >> 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 >> >> >> > >> > > > I almost need an event that is like "on restore", "on minimize". Here's a post from Herfried a while back that may help:> 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'. ------------------------------------------------------ > 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 /// -- Show quoteHide quoteM 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_em***@yahoo.com> wrote in message > news:1159883123.594712.139790@i3g2000cwc.googlegroups.com... > > 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" <miron***@golden.net> wrote in message > >> news:e%23q8ZXo5GHA.4116@TK2MSFTNGP03.phx.gbl... > >> >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_em***@yahoo.com> wrote in message > >> > news:1159823098.916551.166770@i3g2000cwc.googlegroups.com... > >> >> 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 > >> >> > >> > > >> > > > 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 Show quoteHide quote "rowe_newsgroups" <rowe_em***@yahoo.com> wrote in message news:1159886174.239890.321310@h48g2000cwc.googlegroups.com... >> 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_em***@yahoo.com> wrote in message >> news:1159883123.594712.139790@i3g2000cwc.googlegroups.com... >> > 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" <miron***@golden.net> wrote in message >> >> news:e%23q8ZXo5GHA.4116@TK2MSFTNGP03.phx.gbl... >> >> >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_em***@yahoo.com> wrote in message >> >> > news:1159823098.916551.166770@i3g2000cwc.googlegroups.com... >> >> >> 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 >> >> >> >> >> > >> >> > >> > > > I tried to put Why not just put "Exit Sub" in the restore and minimize Cases? That> 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 maximi would completely disable the buttons as it stops the message from being sent. Thanks, Seth Rowe Miro wrote: Show quoteHide quote > 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_em***@yahoo.com> wrote in message > news:1159886174.239890.321310@h48g2000cwc.googlegroups.com... > >> 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_em***@yahoo.com> wrote in message > >> news:1159883123.594712.139790@i3g2000cwc.googlegroups.com... > >> > 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" <miron***@golden.net> wrote in message > >> >> news:e%23q8ZXo5GHA.4116@TK2MSFTNGP03.phx.gbl... > >> >> >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_em***@yahoo.com> wrote in message > >> >> > news:1159823098.916551.166770@i3g2000cwc.googlegroups.com... > >> >> >> 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 > >> >> >> > >> >> > > >> >> > > >> > > > Excellent!!!! :-) :-)
Worked like a charm. The buttons are still up there - I can live with that, but but visual aspect of the application will stay how it is. Exit Sub looks like the answer. - I have much to learn still. Thank you very much for all your help. Miro Show quoteHide quote "rowe_newsgroups" <rowe_em***@yahoo.com> wrote in message news:1159919303.149796.250840@m73g2000cwd.googlegroups.com... >> 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 maximi > > Why not just put "Exit Sub" in the restore and minimize Cases? That > would completely disable the buttons as it stops the message from being > sent. > > Thanks, > > Seth Rowe > > > Miro wrote: >> 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_em***@yahoo.com> wrote in message >> news:1159886174.239890.321310@h48g2000cwc.googlegroups.com... >> >> 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_em***@yahoo.com> wrote in message >> >> news:1159883123.594712.139790@i3g2000cwc.googlegroups.com... >> >> > 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" <miron***@golden.net> wrote in message >> >> >> news:e%23q8ZXo5GHA.4116@TK2MSFTNGP03.phx.gbl... >> >> >> >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_em***@yahoo.com> wrote in message >> >> >> > news:1159823098.916551.166770@i3g2000cwc.googlegroups.com... >> >> >> >> 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 >> >> >> >> >> >> >> > >> >> >> > >> >> > >> > > "Miro" <miron***@golden.net> schrieb: Maybe it's more appropriate to use a set of user controls instead of the MDI > Im trying to create an mdi child form that will always be maximized and > can never be minimized / whatever by the user. children. MDI children typically represent documents. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> Miro wrote:
Show quoteHide quote > I created an MDI form and made a child form. These may help.> > 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 http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_frm/thread/26aa9dd310503b0a http://groups.google.com/group/microsoft.public.dotnet.framework/browse_frm/thread/4e9d658a72c36f64 B.
Q: closing forms
CURRENT INDEX of Iteration on ILIST collection ? 1.1 equivalent for Drawing.Icon.ExtractAssociatedIcon? Accessing the Class Name of a Shared Method Help with using bits in an integer Writing Custom DLLs in VB.net 2 Recursive Directory / File Listing With Progress? new form use try catch to check a text box copy and paste into webbrowser |
|||||||||||||||||||||||