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?
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?
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.