There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
VB 6 MDI Question


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
websurfer's Avatar
Senior Member with 1,985 posts.
 
Join Date: Jun 2002
Location: Louisiana
Experience: Advanced
19-Dec-2003, 06:06 PM #1
VB 6 MDI Question
Can someone explain how to load and unload forms in MDI please, I'm working on the next version of my app and I don't want a lot of different windows loading and unloading.

Also, how can I make a variable be the same in all of these different forms, for example, can I set varTest1 to 5 in form1, and then in form2 add to it to make it 7? I want to know because at the end, I want all the text boxes of the different forms to come together in a text file to make a CSS.
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
19-Dec-2003, 07:01 PM #2
I've worked with MDI applications only briefly but I believe that you load forms in the MDI interface by instantiating a new instance of them. For example:

Dim myForm as New Form1
myForm.Show

It's either that or

Load Form1

About having a variable accessible to all forms within your project, if you add a module to the project (not a class module) and declare the variable Public in that module then its scope is the entire project and you can manipulate it from any where else in your code.
websurfer's Avatar
Senior Member with 1,985 posts.
 
Join Date: Jun 2002
Location: Louisiana
Experience: Advanced
19-Dec-2003, 07:07 PM #3
How do I delcare the variable public in the module?

Sorry, I'm pretty much a noob with VB.
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
19-Dec-2003, 07:09 PM #4
Public varname As <type>

Type can be any valid variable type. You'll get a list of them when you hit the space after the "As"
websurfer's Avatar
Senior Member with 1,985 posts.
 
Join Date: Jun 2002
Location: Louisiana
Experience: Advanced
19-Dec-2003, 07:21 PM #5
Thanks again, one more question, is it possible to dock the forms in the MDI, and to set the percent amount that they occupy?
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
19-Dec-2003, 07:50 PM #6
Not natively (that I'm aware of.) You can write your own code to specify the amount of space each child window is allowed to consume. I don't have any idea how you would dock a child window in an MDI container. Sorry.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:15 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.