Feb 16th, 2005, 05:09 PM
#1
Thread Starter
Member
Creating a "Sub" form like in Word...[BACK OPEN]
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?
Last edited by Myriad_Rocker; Feb 16th, 2005 at 06:18 PM .
Myriad Rocker
The ability to speak does not make you intelligent
I haven't had VB since college...go easy.
Feb 16th, 2005, 05:13 PM
#2
Re: Creating a "Sub" form like in Word...
Feb 16th, 2005, 05:13 PM
#3
Re: Creating a "Sub" form like in Word...
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 16th, 2005, 05:17 PM
#4
Thread Starter
Member
Re: Creating a "Sub" form like in Word...
So the ENTIRE project needs to be MDI? If so, can I convert a regular form to MDI without having to redesign it?
Myriad Rocker
The ability to speak does not make you intelligent
I haven't had VB since college...go easy.
Feb 16th, 2005, 05:19 PM
#5
Re: Creating a "Sub" form like in Word...
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 16th, 2005, 05:30 PM
#6
Thread Starter
Member
Re: Creating a "Sub" form like in Word...
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.
Myriad Rocker
The ability to speak does not make you intelligent
I haven't had VB since college...go easy.
Feb 16th, 2005, 05:35 PM
#7
Thread Starter
Member
Re: Creating a "Sub" form like in Word...
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?
Myriad Rocker
The ability to speak does not make you intelligent
I haven't had VB since college...go easy.
Feb 16th, 2005, 05:44 PM
#8
Re: Creating a "Sub" form like in Word...
You got it! Although there are a few things about MDI apps that take special attention,
but if you have any problems let us know.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 16th, 2005, 05:46 PM
#9
Thread Starter
Member
Re: Creating a "Sub" form like in Word...
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....
Myriad Rocker
The ability to speak does not make you intelligent
I haven't had VB since college...go easy.
Feb 16th, 2005, 05:47 PM
#10
Re: Creating a "Sub" form like in Word...
You mean like have another non MDI form as the startup object and then go to
your MDI parent? If so then yes.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 16th, 2005, 05:48 PM
#11
Thread Starter
Member
Re: Creating a "Sub" form like in Word...
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.
Myriad Rocker
The ability to speak does not make you intelligent
I haven't had VB since college...go easy.
Feb 16th, 2005, 05:51 PM
#12
Re: Creating a "Sub" form like in Word...
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 16th, 2005, 05:53 PM
#13
Thread Starter
Member
Re: Creating a "Sub" form like in Word...
Myriad Rocker
The ability to speak does not make you intelligent
I haven't had VB since college...go easy.
Feb 16th, 2005, 05:55 PM
#14
Re: Creating a "Sub" form like in Word...[RESOLVED]
Your Welcome.
Thanks for saying thanks. Sometimes people forget that we help for free.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 16th, 2005, 06:19 PM
#15
Thread Starter
Member
Re: Creating a "Sub" form like in Word...[BACK OPEN]
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.
Myriad Rocker
The ability to speak does not make you intelligent
I haven't had VB since college...go easy.
Feb 16th, 2005, 06:48 PM
#16
Re: Creating a "Sub" form like in Word...[BACK OPEN]
I'm not an MDI expert, but I will try my best.
Are we talking about positioning the form or docking the form?
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 17th, 2005, 09:43 AM
#17
Thread Starter
Member
Re: Creating a "Sub" form like in Word...[BACK OPEN]
I have attached an image example. The arrow shows where I want the child form to be on the MDI parent.
Attached Images
Myriad Rocker
The ability to speak does not make you intelligent
I haven't had VB since college...go easy.
Feb 17th, 2005, 12:42 PM
#18
Re: Creating a "Sub" form like in Word...[BACK OPEN]
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
Attached Images
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 17th, 2005, 01:58 PM
#19
Thread Starter
Member
Re: Creating a "Sub" form like in Word...[BACK OPEN]
Awesome!!!!! You Rule!!!!!!
Myriad Rocker
The ability to speak does not make you intelligent
I haven't had VB since college...go easy.
Feb 17th, 2005, 02:03 PM
#20
Re: Creating a "Sub" form like in Word...[BACK OPEN]
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 17th, 2005, 02:11 PM
#21
Thread Starter
Member
Re: Creating a "Sub" form like in Word...[BACK OPEN]
Originally Posted by
RobDog888
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.
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?
Myriad Rocker
The ability to speak does not make you intelligent
I haven't had VB since college...go easy.
Feb 17th, 2005, 02:13 PM
#22
Re: Creating a "Sub" form like in Word...[BACK OPEN]
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
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 17th, 2005, 02:19 PM
#23
Thread Starter
Member
Re: Creating a "Sub" form like in Word...[BACK OPEN]
Oh, okay!!! You get it to act in the same manner as when it is maximized! Thanks again!
Myriad Rocker
The ability to speak does not make you intelligent
I haven't had VB since college...go easy.
Feb 17th, 2005, 02:24 PM
#24
Re: Creating a "Sub" form like in Word...[BACK OPEN]
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width