LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I copy one panel's color to another panel?

Hi,
 
Is there a way to copy a control's color (for instance a panel background) and "paste" it into another control?
 
Thanks
Rafi
0 Kudos
Message 1 of 5
(3,520 Views)

Hello Rafi,

you could use the functions GetPanelAttribute and SetPanelAttribute, with ATTR_BACKCOLOR in the attribute field. A similar thing can be done with most of the controls, using GetCtrlAttribute and SetCtrlAttribute.

0 Kudos
Message 2 of 5
(3,513 Views)

It is surely possible in case of controls: GetCtrlAttribute ans SetCtrlAttribute permit you to retrieve individual elements of each control and copy them to a different control (be careful: not all attributes are settable for all controls: the online help for the command lists all the attributes and specify for each one of them if it's settable or not).

Regarding panel attributes like in your example, if the panel is stated to "Conform to system colors" you cannot modify the background color and you'll get an error in attempting it. You will need to test this attribute before trying to modify panel colors. The "Conform to system colors" attribute can be set either at run time or in the UIR editor (button "Other attributes" of the Edit panel dialog box).



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 3 of 5
(3,513 Views)
Thanks for the answers,
 
Actually I meant to change the colors in the UIR editor....Is it possible?  (If not, then, I could use the ATTRIBUTES settings...)
 
Thanks
Rafi
0 Kudos
Message 4 of 5
(3,501 Views)


@Rafi2003 wrote:
Thanks for the answers,
 
Actually I meant to change the colors in the UIR editor....Is it possible?  (If not, then, I could use the ATTRIBUTES settings...)
 
Thanks
Rafi



Ah! To copy a color in the UIR editor simply select the coloring tool (the pointer will became a brush), next press Ctrl button (the pointer will became a dropper) and left-click on an object while keeping Ctrl pressed: its color will be copied in the brush color and you will be able to paint subsequent objects with the same color, even on different panels. This works also for panel backgrounds.


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 5 of 5
(3,497 Views)