Results 1 to 24 of 24

Thread: Creating a "Sub" form like in Word...[BACK OPEN]

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2004
    Location
    Everywhere
    Posts
    46

    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.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Creating a "Sub" form like in Word...

    try using vbMaximized

    VB Code:
    1. Show myform, vbMaximized

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2004
    Location
    Everywhere
    Posts
    46

    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.

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  6. #6

    Thread Starter
    Member
    Join Date
    Nov 2004
    Location
    Everywhere
    Posts
    46

    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.

  7. #7

    Thread Starter
    Member
    Join Date
    Nov 2004
    Location
    Everywhere
    Posts
    46

    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.

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  9. #9

    Thread Starter
    Member
    Join Date
    Nov 2004
    Location
    Everywhere
    Posts
    46

    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.

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  11. #11

    Thread Starter
    Member
    Join Date
    Nov 2004
    Location
    Everywhere
    Posts
    46

    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.

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  13. #13

    Thread Starter
    Member
    Join Date
    Nov 2004
    Location
    Everywhere
    Posts
    46

    Re: Creating a "Sub" form like in Word...

    Awesome. Thank you.
    Myriad Rocker
    The ability to speak does not make you intelligent

    I haven't had VB since college...go easy.

  14. #14
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  15. #15

    Thread Starter
    Member
    Join Date
    Nov 2004
    Location
    Everywhere
    Posts
    46

    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.

  16. #16
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  17. #17

    Thread Starter
    Member
    Join Date
    Nov 2004
    Location
    Everywhere
    Posts
    46

    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 Attached Images  
    Myriad Rocker
    The ability to speak does not make you intelligent

    I haven't had VB since college...go easy.

  18. #18
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Creating a "Sub" form like in Word...[BACK OPEN]

    Like this?
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub MDIForm_Load()
    4.     MDIForm1.Height = 4000
    5.     MDIForm1.Width = 6000
    6.     Form1.Width = MDIForm1.Width / 4
    7.     Form1.Height = MDIForm1.Height - 875
    8.     Form1.Move MDIForm1.ScaleWidth - Form1.ScaleWidth - 125
    9.     Form1.Show
    10. End Sub
    Attached Images 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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  19. #19

    Thread Starter
    Member
    Join Date
    Nov 2004
    Location
    Everywhere
    Posts
    46

    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.

  20. #20
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  21. #21

    Thread Starter
    Member
    Join Date
    Nov 2004
    Location
    Everywhere
    Posts
    46

    Re: Creating a "Sub" form like in Word...[BACK OPEN]

    Quote 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.

  22. #22
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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:
    1. Option Explicit
    2.  
    3. Private Sub MDIForm_Load()
    4.     MDIForm1.Height = 4000
    5.     MDIForm1.Width = 6000
    6.     Form1.Width = MDIForm1.Width / 4
    7.     Form1.Height = MDIForm1.Height - 875
    8.     Form1.Move MDIForm1.ScaleWidth - Form1.ScaleWidth - 125
    9.     Form1.Show
    10. End Sub
    11.  
    12. Private Sub MDIForm_Resize()
    13.     Form1.Width = MDIForm1.Width / 4
    14.     Form1.Height = MDIForm1.Height - 875
    15.     Form1.Move MDIForm1.ScaleWidth - Form1.ScaleWidth - 125
    16. 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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  23. #23

    Thread Starter
    Member
    Join Date
    Nov 2004
    Location
    Everywhere
    Posts
    46

    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.

  24. #24
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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
  •  



Click Here to Expand Forum to Full Width