You know when you don't have anything open but when you go File, New....then you get the word processor. You can maximize within the application blah blah.
How do you do that in VB6?
Printable View
You know when you don't have anything open but when you go File, New....then you get the word processor. You can maximize within the application blah blah.
How do you do that in VB6?
try using vbMaximized
VB Code:
Show myform, vbMaximized
That an MDI type of application. Add a new form to your app and select MDI Form. Then the forms
that you want to be "inside" set those forms MDI Child = true.
So the ENTIRE project needs to be MDI? If so, can I convert a regular form to MDI without having to redesign it?
No, not the parent MDI form, but you could probably paste the code in and use what is relevant.
Usually you have all the controls on the child forms.
Only exception is the menu. Both parent and child menus can be used together when merged.
I'm sorry...I don't understand. Let's just say I'm starting with a blank project. For now, I just want one sub or child form in the main app.
Okay, I think I understand now...as long as your initial form is an MDI form, and you set all other forms to child=true, you're good to go......right?
You got it! :thumb: Although there are a few things about MDI apps that take special attention,
but if you have any problems let us know.
One more question....Is there a way I can change what form initially loads up when I run the program? That way I don't have to completely start over....
You mean like have another non MDI form as the startup object and then go to
your MDI parent? If so then yes.
No, I don't think. See, I have a non-MDI form as my startup because I've already done some initial design. Now that I can do the MDI thing, I want to make the MDI parent be the start up form.
You can make any form you want as the startup object, except for a MDI Child form.
Go to Project > Properties > General tab > choose you startup form from the cbo and click ok.
Awesome. Thank you.
Your Welcome. :thumb:
Thanks for saying thanks. Sometimes people forget that we help for free. :D
Hey, no prob. I really appreciate it.
So I don't clutter the place up with threads that are related, I just opened this one back up.
How do I align an MDI child form to a certain side of the MDI parent? By default, I believe it aligns to the left. I want it to align on the right hand side.
I'm not an MDI expert, but I will try my best.
Are we talking about positioning the form or docking the form?
I have attached an image example. The arrow shows where I want the child form to be on the MDI parent.
Like this?
VB Code:
Option Explicit Private Sub MDIForm_Load() MDIForm1.Height = 4000 MDIForm1.Width = 6000 Form1.Width = MDIForm1.Width / 4 Form1.Height = MDIForm1.Height - 875 Form1.Move MDIForm1.ScaleWidth - Form1.ScaleWidth - 125 Form1.Show End Sub
Awesome!!!!! You Rule!!!!!!
Now dont forget (depending on how this is actually needed to work) to remove the
min/max buttons. Also, you need to write some code inthe Form_Resize event so if the
user resizes the main mdi form the "docked" child form will resize accordingly.
Ps, Thanks.
Quote:
Originally Posted by RobDog888
Alright, now I'm confused again. I'm totally understand what you're getting at, though. I even tested it and if I resize the form (from a user perspective) the child form just stays where it is....so....how do I accomplish getting the child form to resize according to the parent?
This will keep it docked to the top right of the MDI parent dring a user resize.
VB Code:
Option Explicit Private Sub MDIForm_Load() MDIForm1.Height = 4000 MDIForm1.Width = 6000 Form1.Width = MDIForm1.Width / 4 Form1.Height = MDIForm1.Height - 875 Form1.Move MDIForm1.ScaleWidth - Form1.ScaleWidth - 125 Form1.Show End Sub Private Sub MDIForm_Resize() Form1.Width = MDIForm1.Width / 4 Form1.Height = MDIForm1.Height - 875 Form1.Move MDIForm1.ScaleWidth - Form1.ScaleWidth - 125 End Sub
Oh, okay!!! You get it to act in the same manner as when it is maximized! Thanks again!
Just set the Form1.Width to a fixed size if you dont want it to be porporionate with the parent window.
Play with it a while. I think you will find another question on this. ;)