Hola Masters,
I tried to use the GRID_WIDTH_AUTOSIZE and get the column width :
DATA = WIDTH
A = 25
AB = 27
ABC = 36
ABCD = 45
ABCDE = 53
ABCDEF = 60
ABCDEFG = 69
ABCDEFGH = 78
ABCDEFGHI = 81
ABCDEFGHIJ = 87
Can i have the formular to calculate the width of the column in order to fit my data ?
Thks n Rgds
Chang
Formula to calculate the Grid Column Width by GRID_WIDTH_AUTOSIZE
Moderator: Rathinagiri
Formula to calculate the Grid Column Width by GRID_WIDTH_AUTOSIZE
- Attachments
-
- grid width.JPG (77.24 KiB) Viewed 766 times
Just Hmg It !
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: Formula to calculate the Grid Column Width by GRID_WIDTH_AUTOSIZE
hi,
you need not to "calculate" as Listview can do it for you
you can "click" on line between Column to re-size Column
you can do it with this Code
LVSCW_AUTOSIZE use longest Cell while LVSCW_AUTOSIZE_USEHEADER use Header Description to calculate optimal Size
you need not to "calculate" as Listview can do it for you
you can "click" on line between Column to re-size Column
you can do it with this Code
Code: Select all
hGrid := GetControlHandle( "Browse_1", "BLPRESS" )
FOR i := 1 TO iMax
// LISTVIEW_SETCOLUMNWIDTH( hGrid, i - 1, -1 ) // LVSCW_AUTOSIZE
LISTVIEW_SETCOLUMNWIDTH( hGrid, i - 1, - 2 ) // LVSCW_AUTOSIZE_USEHEADER
NEXT
have fun
Jimmy
Jimmy