Navigation: How To's and Troubleshooting > How to… >====== How to Autosize all Columns in a Browse Box when the Window Opens ====== | |
A feature is available in Clarion Win32 that allows the auto-sizing of Browse Box columns available from the Global Properties App Settings tab control. At runtime, double-clicking on a column auto sizes the column to fit the data contents.
There is a simple way to extended this feature and get all the columns in a browse box to autosize when the window opens.
Set the following property after the browse box is initialized, and after the list box has been populated:
BRWx::AutoSizeColumn.ResizeAll()
where BRWx is equal to the instance of the browse object. A good embed point is the very last embed point provided by the Window Manager's Init method:
! Prepare Alert Keys
SELF.SetAlerts()
! [Priority 9001]
BRW1::AutoSizeColumn.Init()
BRW1::AutoSizeColumn.AddListBox(?Browse:1,Queue:Browse:1)
! [Priority 9550]
BRW1::AutoSizeColumn.ResizeAll()
! End of “WindowManager Method Executable Code Section”
RETURN ReturnValue