MTblAutoSizeColumn
bOk = MTblAutoSizeColumn( hWndTbl, hWndCol, nFlags )
Adjusts the width of a column ( or all columns ) according to his widest contents.
Parameters
hWndTbl
Window Handle: Handle of the table
hWndCol
Window Handle: Handle of the column. Specify hWndNULL to size all columns.
nFlags
Number: Optional flags:
MTASC_ALLROWS |
All ( currently fetched ) rows are used to determine the best width. |
MTASC_BTNSPACE |
When the table flag MTBL_FLAG_BUTTONS_OUTSIDE_CELL is not set, the width of buttons ( M!Table buttons or the drop down button in a drop down list column ) are calculated into the column width. |
MTASC_HIDDENCOLS |
Adjusts also the width of hidden columns. |
MTASC_HIDDENROWS |
Hidden rows are also used to determine the best width. |
MTASC_INCREASE_ONLY |
The column width is only adjusted when the calculated best width exceeds the current width |
MTASC_SPLITROWS |
Split rows are also used to determine the best width |
Return
Boolean: TRUE if successful or FALSE if an error occurs
Example
In this example a column's width is adjusted using all visible normal and split rows when the user double clicks the separator:
On MTM_ColHdrSepLBtnDblClk
Call MTblAutoSizeColumn( hWndForm, SalNumberToWindowHandle( wParam ), MTASC_ALLROWS | MTASC_SPLITROWS )
Remarks
Unlike VisTblAutoSizeColumn, all M!Table extensions are supported!
See also
Automatic column sizing
Automatic row sizing
Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator