Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Autoresize Grid Column
Message
 
 
To
09/07/2005 07:17:19
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01030837
Message ID:
01030921
Views:
28
Jim,

Thanks for posting the code.

Column resizing isn't a very clear cut thing at all. If there are too many columns to fit in the visible space and the rid gets larger in width does the user want to see more columns or do they want the currently visible columns to each get wider?

>I have been able to accomplish this by adding some custom methods to Greg Reichert's AutoResize class which is available in the downloads section here. Basically, you need to calculate the number of pixels that the grid width changes and distribute that number across the visible columns. Since a pixel is an integer, you must divide the change in pixels by the number of columns to be sized and apply the integer portion of the result to each column. Then you must calculate the remainder and apply it to one of the columns. The same strategy can be used to size a list box.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform