Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Structuring a VB5 app: user controls or setparent?

Posted on 1998-08-06
5
Medium Priority
?
162 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 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.

0
 

Author Comment

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

Expert Comment

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

Author Comment

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

Expert Comment

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

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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

783 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