Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Absolute width of a populated grid?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00340587
Message ID:
00341695
Views:
20
Nigel,

Here's a method I use to find the minimum width a grid needs to be completely visible.
local i, j

j = 10 + sysmetric( 5 ) + 2 * this.GridLineWidth && record marker & vertical scroll bar
for i = 1 to this.ColumnCount
   with this.Columns[i]
      j = j + .Width + this.GridLineWidth
   endwith
endfor

return j
In this grid I have the DeletedMarker turned off otherwise you need another 10 pixels in the first assignment.

>I give up! Is there any easy way of identifying how wide a grid is after populating. Something along the lines of grid.totalwidth would be great. I'm leaning towards adding up the widths of each column but that is still a long way short of the actual width.
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