Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid horizontal scrollbars on demand
Message
De
28/12/2016 09:41:36
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012
Database:
MS SQL Server
Application:
Robot
Divers
Thread ID:
01646151
Message ID:
01646152
Vues:
88
This message has been marked as the solution to the initial question of the thread.
>Hello,
>
>I am trying to figure out to switch on horizontal scrollbars on a grid but only when the total number of columns is wider than the grid width.
>
>Otherwise you get the empty scrollbar on the bottom of the grid and it only wastes the space.
>
>However I have trouble figuring out if the columns total width is larger than the grid width, because the numbers don't match. The combined width of all columns is less than the grid width property. I also thought there is a fixed number of pixels per column that would need to be added, but also it does not match. Anyone has an idea how to get this to work?
>
>The general idea is as follows:
>
>LOCAL lnTotalWidthColumns
>lnTotalWidthColumns = 0
>*
>FOR EACH loColumn IN THIS.Columns
>    lnTotalWidthColumns = lnTotalWidthColumns + loColumn.Width
>ENDFOR
>*
>IF THIS.Width < lnTotalWidthColumns
>    THIS.Scrollbars = 3
>ELSE
>    THIS.Scrollbars = 2
>ENDIF
>
Add one for the gridline pixel for each column, plus sysmetric(5) for the vertical scrollbar width. Also perhaps some other sysmetric() for deletemark and recordmark, if you keep them visible. That should be the total width of the grid.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform