From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change parent of a control

I am suing Lanwindows/CVI 2012 SP1, and I have 2 questions:

 

1) I created a tabpage and inserted a table. I created a button outside of the tab, near tabpage contol. How can I move the button control to tabpage? The parent of the button is the main window. I want to move it inside of the tab page. If I move it goes behind the tab page.

 

2) Is there a source file wich is responsible for the placing the controls on the window during start-up? 

 

Thanks.

0 Kudos
Message 1 of 4
(4,301 Views)

1) You cannot "move" a control from a panel to a page of a tab control of that panel: you must cut the control from the main panel and paste it on the tab control page. You must consider tab pages as independent panels (they have also an independent handle).

 

2) If I correctly understand what yoy are saying, you can use NewCtrl or DuplicateCtrl at runtime to create controls. A series of SetCtrlAttributes will permit then to customize the new controls as you want.



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?
0 Kudos
Message 2 of 4
(4,300 Views)

Thank you for quick reply. First question is answered, I didn't think that it was so easy 🙂

For the second question, I meant, there shall be a source file in which the initialization of the controls  is being made. For example, I put a numeric control on the window and I run the program, It shows the numeric control. But It shall be created in somewhere with NewCtrl and SetCtrlAttribute functions? Or Am I wrong?

0 Kudos
Message 3 of 4
(4,297 Views)

No need to do anything for controls that you created and customized at design time in the UIR editor.

I mean: create a panel ans all controls needed, save it, include it in the project and load with LoadPanel + DisplayPanel and that's all: CVI takes care of declaring, creating and customizing UI objects according to what you set in the UIR file.

What is in charge to you is to manipulate those objects according to your needs: as an example, a numeric will be shown with its default value, if you want to display a different value you must call SetCtrlVal.



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?
0 Kudos
Message 4 of 4
(4,294 Views)