Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid -how to size to outer container?
Message
From
12/01/2007 15:08:57
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
12/01/2007 14:51:46
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01185226
Message ID:
01185234
Views:
15
This message has been marked as the solution to the initial question of the thread.
>Hi Y'all,
>
>It used to be that if I set the size of the columns inside of a grid to be exactly the width of the overall grid container (with maybe 1 pixel less for the last column), if the user tabbed across the column, when they came to the last column it would jump back to the first column (which might be a framework feature - VMP - I don't know). What I had to do was make sure that the last column was sized such that you could see the vertical grid line inside the grid.
>
>Now when converting my customer's app to VFP9, by default even though the right-side grid line of the last column is set to be inside the grid container, at run time the vertical grid line disappears and when the user tabs to the end of the row, the grid "jumps" to a fake column (column number n+1) and they wonder whats up. There is no horizontal scroll bar by the way.
>
>I had to increase the size of the grid container to be +6 pixels wider than what would normally be required in order to a) see the last right-most vertical grid line and b) to preventing the "jumping". But then what the user sees is a skinny blank column about 1/4" wide on the screen which looks out of place.
>
>Is there a way around this behaviour? I could not find a property that more or less says "Lock columns in place" or something.

I once had a framework where this used to happen, so I came up with this bit of code. Goes to the end of grid.init:
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
This will break if there's no room for the last column - it would give you a negative width.

back to same old

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

Click here to load this message in the networking platform