‎11-24-2025 03:17 AM - edited ‎11-24-2025 03:23 AM
I have a table with fixed font size of 11 and font Microsoft YaHei UI. If the panel is not maximized the font looks good. If I maximize the panel, all controls incl. the table are scaled to the new size (looks sometimes weird but its ok). The font seems also be ok, but If I update the table (delete all rows and add new) the font is very tiny. I add a picture of the problem.
Solved! Go to Solution.
‎11-24-2025 07:19 AM
Looks like a strange effect of panel scaling during resize: you can exclude panel scaling by unchecking Scale Contents On Resize checkbox in Other Attributes... window i panel settings, or programmatically by calling SetPanelAttribute with ATTR_SCALE_CONTENTS_ON_RESIZE attribute and value 0.
‎11-25-2025 12:37 AM - edited ‎11-25-2025 12:40 AM
Thanks for your answer. Scale contents on resize is active, because I want that all controls are scaled, so I cant deactivate it. The table is ony of many controls on the panel.
The problem is rather strange somehow because If I maximize the panel the table is fine. But after updating the contents of the table the size is small.
‎11-25-2025 02:35 AM
An alternative approach to panel scaling could be the use of splitters to define how the panel is changed when its dimensions change. Splitter permits to choose between sizing or moving controls, giving you a more flexible approach to resizing. I personally don't like the effect of rescaling and prefer to use splitters.
You can either manually add splitters to your panel and attach controls to them in the UIR editor or you may want to take a look at the good code provided by NickB long time ago:
LabWindows/CVI Tip: Use Splitter Controls to Handle Panel Sizing
‎12-01-2025 07:07 AM
Thanks for the splitter example. I tried to implement it but I cannot use it with my big panel. Because I have lot of different controls and the results are looking very weird. For only few buttons and a graph its ok.
‎12-01-2025 08:00 AM - edited ‎12-01-2025 08:04 AM
I understand, there may be several possible solutions to almost any problem. The fact is that I don't like the aspect panels take when simply rescaled, so I followed the splitter way short after these controls were added to CVI. For this reason I cannot help you a lot with this problem.
A rude approach to it could be to trap the panel size event and:
hoping that this at least avoids that the table font changes after redraw.
‎12-02-2025 12:54 AM
Thanks, this was a good hint. I changed my update table function. This works for me 🙂
‎12-02-2025 02:30 AM - edited ‎12-02-2025 02:31 AM
Great! I'm glad to have helped you.
Pay attention to SetTableRowAttribute (), as it affects only new cells added to the row.
For existing cells in the table you may use SetTableCellRangeAttribute () passing VAL_TABLE_ENTIRE_RANGE macro as the range.