Solved

Structuring a VB5 app: user controls or setparent?

Posted on 1998-08-06
5
148 Views
Last Modified: 2010-04-30
Hi,

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.
0
Comment
Question by:cellphone
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
BlackAndWhite earned 200 total points
Comment Utility
'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.

0
 

Author Comment

by:cellphone
Comment Utility
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
0
 
LVL 1

Expert Comment

by:BlackAndWhite
Comment Utility
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.
0
 

Author Comment

by:cellphone
Comment Utility
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
0
 
LVL 1

Expert Comment

by:BlackAndWhite
Comment Utility
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'.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) 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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now