04-24-2007 12:25 PM
I want to auto size table cells (both the height and width) based on the text strings they display. Some of the text strings have multiple lines. I have tried setting the ATTR_SIZE_MODE to the SIZE_TO_CELL parameters but it did not achieve the desired results. Basically I would like the cells to be sized as if the user double-clicked the row and column separators. I have used the GetTextDisplaySize function in the past but I was hoping I’m just missing something simple.
04-25-2007 02:13 AM
Hello John,
There is a function SetColumnWidthToWidestCellContents to adjust the column width automatically. It's actually in the "Trees" library, but if works for tables too. Unfortunately there is no SetRowHeightToHighestCellContents or some function like that
04-25-2007 02:16 AM - edited 04-25-2007 02:16 AM
...
Message Edited by Wim S on 04-25-2007 09:17 AM
04-25-2007 09:45 AM
Thanks that does the trick for the width. I never thought to look in the tree control functions. The CVI help does not list that function as one of “Table Control Functions” but in the detailed function description it does refer to a table column.
It would be nice if they had a similar function for the row height.
Thanks again for your help.
John
04-26-2007 11:29 AM
04-26-2007 12:46 PM
Luis:
Thanks that also helps.
John
01-09-2008 02:34 PM
01-09-2008 06:01 PM
01-11-2008 07:57 AM
01-11-2008 08:08 AM
Hi Marcel,
thanks a lot for posting the code. It's always nice if some code can be reused by other people