A common user interface requirement is to ensure proper layout for your controls when the window hosting the controls is resized. As a LabWindows/CVI developer, you might attack this problem in a couple different ways:
Explicitly respond to panel sizing events and programmatically move and size all the controls on the panel accordingly.
This is cumbersome, and puts the entire burden of control management on the developer. Countless hours may be spent perfecting algorithms and refining layouts.
Enable the "Scale Contents on Resize" option for each panel.
This doesn't require any time from the developer, but results in a UI that is not consistent with most other Windows programs.
Use splitter controls to find a happy medium between these two options.
You can attach multiple controls to a splitter control, and define a behavior for each control individually when the splitter moves. You can leverage this behavior to move and size controls automatically when the panel sizes, enabling control over the layout of the controls on your panel. The trick to this is programmatically operating the splitter when the panel sizes with the OperateSplitter CVI library function call. This does require some implementation, but because the sizing and moving of controls is entirely handled by the splitter control, the most burdensome part of the first listed option is removed.
To make things even easier, I've written a very small library (SplitterSizing.c and SplitterSizing.h) that should further simplify the process. It is attached to this post, and exhibited with a simple example program. There are three public functions:
Initializes the library for a particular panel. This function must be called for each panel that requires dynamic layout of it's controls. The function also allows a minimum width and height to be defined for the panel.
Configures a control to be moved when the panel is sized.
Configures a control to be sized when the panel is sized.
The example program does nothing but show the sizing in action. You can manually size the panel, maximize the panel, and move the panel around, but the controls on the panel maintain a very specific layout. Consider the following before and after screenshots: