LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Move Controls

Solved!
Go to solution

I want to move a group of controls along the screen but supporting the distance between them.
There is some function to move the controls along the screen? 

 

Quiero mover un grupo de controles a lo largo de la pantalla pero manteniendo la distancia entre ellos.
Hay alguna función para mover los controles a lo largo de la pantalla?

0 Kudos
Message 1 of 3
(3,193 Views)
Solution
Accepted by topic author Prg_Coruna

I can think of a couple ways to do what you want.

 

Since there is no native CVI function that operates on a group of controls and permits changing an attribute with an increment instead of an absolute value, you could simply iterate on a for loop that scans a series of elements and, for each one, gest the left and/or top attribute and sets it with the desired increment.

This could be made easier if you load an array of control IDs and use array elements inside the loop, or by using Lists from the Programmer's Toolbox; the looping could also be dramatically speeded up by creating a control array and operating on its items.

 

An alternative way to solve this problem is to create a splitter on the panel to which attach desired controls setting "Splitter moves control" as the attachment mode for each of them. The splitter could then be made invisible if you want to move controls programmatically and operated with OperateSplitter (). See uirview.cws and docking.cws examples that demonstrate the use of the command.

The limit to this method is that you can only move controls leftwise of rightwise if you use a vertical splitter, and upward and downward if you use an horizontal splitter.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(3,164 Views)

A an additional alternative, controls you want to move could be placed on a separate panel loaded as a child of the original panel of your application. This way, simply moving the child panel, either interactively or programmatically, automatically moves all controls maintaining their respective positions.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 3 of 3
(3,159 Views)