Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suggestions on Creating SubForms?

Status
Not open for further replies.

Prattaratt

Technical User
Aug 6, 2000
291
US
I am using BCB 5; I am trying to create a Main Form that will change based on a value that is not determined until after the form is created. In MS Access I did this using Subforms by designing 3-4 different forms, and assigning them on the fly. I am trying to figure out how to do something similar using VCL. Any suggestions?
 
I'm not familiar with MS Access SubForms so this may be a shot in the dark. In C++, you can create MDI forms. MDI (Multiple Document Interface) forms have multiple forms or "child windows." You can call these new forms from the parent form. This sort-of sounds like what you want.

You can also create a main window and call Modal or Modaless forms. Modal forms are forms that the user must interact with, such as filling some edit boxes. Modaless forms are windows that display something until the user closes them. For example, an error or warning box.

I can create the modal forms before-hand then create the forms dynamically or call the forms if they have been auto created.

Look the help files to see which you would like to use and then post back with more details if you need more help.


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
I understand the question as such:
The program starts and collect som variable and that variable determines the apperance of the main form, is this correct?

If it's correct there are a few ways that i come to thing about to solve it.

One is panels as c56791 suggests, placing them on top of each other and making only one visible would do the trick.

Another is to make the main form invisible at start and have that to do the collection of the "apperance-value" and then show the appropriate sub-form as "main form" simply by showing it as no other form will be shown before that.
This is what 2ffat suggests.

If all buttons are the same but the apperance value determins wether they are to be placed a certain place, have a certain size and so forth it's quite possible to make the form and write down the placement-values and then rewrite the form to the next apperance and write down those numbers and so forth.

Then You start up the application, checks the apperance-value and sets up all buttons and such according to the values You have written (simple tabel-look-up).

Totte
Keep making it perfect and it will end up broken.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top