Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shifting grid
Message
From
18/12/2008 10:54:05
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
01368158
Message ID:
01368538
Views:
26
>Also, keep in mind, that some of the deminsions of the grid are determined by the OS and themes,
>
>I usually leave several spaces after the last column to prevent problems on different computers.
>
>or you can calculate the exact size needed, if you wish to do this look up the sysmetric function.

...which would look like this:
*[2004/08/16 11:57:28] dragan -  recalculate the width of the last column, 
* depending on width of the vertical scrollbar
n=0
FOR i=1 to this.ColumnCount-1
	n = n + this.Columns[i].width
endfor
*[2004/12/23 08:31:57] dragan - adjust for absence of vertical scrollbar
nWidth=this.width-n-iif(bittest(this.ScrollBars,1),Sysmetric(5)+this.ColumnCount,0)-4
if nwidth>0
	this.Columns[this.columncount].width=nWidth
endif
However, this is not perfect - this works only if at least some of the last column would be visible, i.e. the total width of the previous columns is less than the inner width of the grid. If not so, it would try to assign a negative value, and bang - which is why "if nwidth>0" is there, and then it would to just nothing, but calculate in vain.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform