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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RESIZING ALL CONTENTS OF A WINDOW? 13

Status
Not open for further replies.

dabineri

Programmer
Jun 20, 2001
265
0
0
US
What is the preferred way, in VB6, to create a window that can be re-sized in such a way as all the controls on that window automatically resize also as the window changes?

Thanks for any advice on this, David Abineri


 
Golom, I hope you are still there!

Everything was behaving fine on my desktop machine as I implemented the above code on a form with a TrueDBGrid.

I then started testing on my laptop and I find that sometimes when the grid loads, the first row is NOT showing the actual first row of data AND there are NO vertical scroll bars shwoing in the side of the grid (should be there since I have rows than will fit the grid at one time).

Do you have any idea what might cause these two symptoms? Why would the SAME code not work on each machine?

Thanks, David Abineri


 
Which code are you refering to?

This thread has FormResize code and ColWidths code.

I don't use the TrueDBGrid control so these are just shots in the dark.

If its the FormResize code

- There are internal error traps in the code so you will not see errors that are raised. It is possible that some error is being raised that is causing problems for the grid. Put some code into the class to write errors to a log file so that you can see where errors are being raised.

- You might also try doing a refresh on the grid (assuming that it has a Refresh method) after code resizing.

If its the ColResize Code

-Note that the code I supplied is for a DBGrid (Microsoft Data Bound Grid Control 5.0 (SP3)). If you are using it for a TrueDBGrid then you will need to modify the control type and ensure that the relevant properties exist with the same meanings.

My suspicion is that, because different machines produce different results, your problem is not with the code but rather with the setup on the two machines. Try building a test app with one form and one grid that accesses a local database. You need to eliminate interactions that can occur in complex code to be sure that the effects that you are seeing are in fact, coming from the FormResize code and not from some other place in the system.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top