Link to home
Start Free TrialLog in
Avatar of timnorrismis
timnorrismis

asked on

Visual Basic Multiple Forms Management

I am going to develop a large ERP-type application in VB6, and I need direction on how to handle multiple screens/forms.  I will have some sort of main menu and toolbars, and I want to create a screen area that will contain the forms as they are selected.  For example, with a program like Peachtree or Quickbooks, you have the main toolbars, and then as you select different operations, the work area changes accordingly.  I would like to be able to have multiple forms to be loaded at the same time, and when the user minimizes the main menu section, all the forms will minimize along with it.  Is it possible to achieve this with Visual Basic 6, and if so, can someone get me pointed in the right direction?
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 3_S
3_S

Instead of starting a standard exe project you could start with a new VB entreprise edition controls project.
This gives you a default MDI form and a wizard to add some default action in your menu.
correction use the VB application wizard instead of the VB entreprise editon controls
Some advice on coding large apps in VB6.  

Encapsulate as much as possible.  Never reference any control directly from another form (i.e. never do a form1.textbox1.text="stuff"  from form2)  becuase you might at some point redesign the form, and then you'd have to remember all places you directly referenced a control.  Instead, do property proceedures, so that you only access the form through known channels.  In dot net, I force this by making all controls private (meaning they can't be accessed from outside the form), but I've not found a way to do this in VB6.

This allows you to redo the form's internal construction without worrying how it affects any other forms.

Avoid Global variables as if they were the plauge.  Pass the data to and from the forms.  That way there is no doubt as to what is modifying what.