Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Structuring a VB5 app: user controls or setparent?

Posted on 1998-08-06
Medium Priority
Last Modified: 2010-04-30

I'm an intermediate VB programmer building an app that will useapex  truegrids. I need an insight or two as to the best way to build a commercial compiled single user VB5 app which uses 5 truegrids. The 5 grids will be displayed on 4 tabs (farpoint's tab pro 2.0). They display different collections of records housed in one access database and accessed via DAO 3.5. they will show cities and hotels. Users will need to see three of the grids (on tabs 1 & 2) very often, and grids 4 &  5 once in a while.

One of my major concerns is to keep the app as responsive and fast as possible. Rather than just have all controls (including the grids) on each tab (ending up with one very large form) always loaded, I want to load into memory only those portions of the app the user needs, when they need them, then unload them.

Which of these approaches would you recommend?

1. Create the grid as a single activex usercontrol and set its appearance and data each time its instanced,
2. Put each grid into its own form and its own vb.dll and Setparent it to my main form as it is accessed,
3. do a control array of the grids,

I'd very much appreciate some guidance here.
Question by:cellphone
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Accepted Solution

BlackAndWhite earned 600 total points
ID: 1468129
'Setparent' the grid is going to cause lot of headaches as I have known especially when are doing it from a different form.  The positioning has to be taken care of and it is messy at times.

If I were you I would use a control array and refresh the grids as and when needed ie. when the user tabs into that tab if it is too memory consuming.  

If it is going to display 5 records each in each tab, I would rather have separate grids on each tab and not worry about the form being in memory.


Author Comment

ID: 1468130
what about putting the grid into a usercontrol and instancing it as the user enters a given tab? If I use 5 instances of the usercontrol do I end up with the grid in memory 5 times or once? Thanks

Expert Comment

ID: 1468131
Are you saying that you want to put layer on top of the grid and provide a property and method interface to the underlying grid.  Thats tough and it wouldn't serve the purpose.  It would only increase the amount of memory needed.

Author Comment

ID: 1468132
what about putting the grid into a usercontrol and instancing it as the user enters a given tab? If I use 5 instances of the usercontrol do I end up with the grid in memory 5 times or once? Thanks

Expert Comment

ID: 1468133
You mean you are going to create a usercontrol with the grid as a component inside it... Did you know that you had to write all the code to give the user access to all the properties and methods that the grid itself supported.  Some of it may noteven be accessible to you if you try to do it because of design and run time regulations that the grid has imposed.  

To your question, 'Yes it is more memory consuming and very very tedious'.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question