07-27-2005 12:28 PM
07-28-2005 10:26 AM
In CVI 8.0, there is a new EVENT_COLUMN_SIZE_CHANGE. 8.0 beta should be released the first week of August.
In 7.1, you could use a timer. Enable the timer on the EVENT_LEFT_CLICK when the area clicked on is the column size area (call GetIndexFromPoint to find the area). In the timer callback's EVENT_TIMER_TICK, call GetRelativeMouseState to get the mouse coordinates and whether the left button is down. When the left button is not down, disable the timer and get the new column width. You also have to check in the tree's EVENT_LEFT_DOUBLE_CLICK to see if the user double clicked on the column divider, which will auto size the column. Again, call GetIndexFromPoint, and if the area is VAL_COLUMN_SIZE_AREA, call SetColumnWidthToWidestCellContents to get the new width, set the new width yourself, and swallow the EVENT_LEFT_DOUBLE_CLICK.
Hope this helps.
- jared
07-28-2005 10:45 AM
07-28-2005 03:09 PM