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: 

Make a flat button

Solved!
Go to solution

Dear,

I would like to move out the relief of a bouton in labwindows.

I would like to see a "flat button", like the button in Figure 1, compared to the one in the Fgure 2 (image File attached).

I would like please to know which attributes I can modif to have this style of button ?

 

I used the "windows style" attribute, which is fine, but I cannot set colors that I need for objects. For example, with the "windows style" attribute of a Panel, the font of the TAB objects are forced to gray.

 

So I would like to have flat buttons (without reliefs, like shown in Figure 1), while continuing to have a control of colors for insered objects.

Thank you so much for yours answer.

Best regards,

--

hapiest

0 Kudos
Message 1 of 11
(5,175 Views)

You might want to try the 'Classic Style' controls.

If you want to use your own colors you have to uncheck 'Conform to System Colors' and 'Use Windows Visual Styles for Controls' in the 'Other Attributes' panel of the 'Edit Panel' panel.

0 Kudos
Message 2 of 11
(5,171 Views)

I used both:

uncheck 'Conform to System Colors' and

check 'Use Windows Visual Styles for Controls'

 

but the colors of TAB object is forced to gray when the TAB is  insered in the PANEL object. I need to still have a control of colors for the insered TAB, but I do not know how?

Could you please tell me how?

Thank you in advance.

Best regards,

--

hapiest

0 Kudos
Message 3 of 11
(5,166 Views)

@hapiest wrote:

I used both:

uncheck 'Conform to System Colors' and

check 'Use Windows Visual Styles for Controls'


You have to

- uncheck 'Conform to System Colors'

and

- uncheck 'Use Windows Visual Styles for Controls'

 

Then you can color your buttons as you wish...

0 Kudos
Message 4 of 11
(5,162 Views)

Use Windows Visual Style for Controls attribute is stronger than Conform to System: that's why your tab control still looks gray.

If you want to customize the appearance of the tab control you need to abandon Windows style. This can be done at panel level in the UIR editor as Wolfgang suggested or can be done programmatically for a single control (e.g. your tab control) by calling SetCtrlAttribute with ATTR_DISABLE_PANEL_THEME attribute. Customization of the tab control must then be done programmatically by setting all the attributes you need.

As a guidance, you may want to take a look at the UI to Code Converter item in the Tools menu: given a UIR file and selected one or more panels to elaborate, the tool will return a source file with the instructions to programmatically generate from scratch the panel and all controls together with all customizations needed: from this code file you can extract the instructions needed to customize your tab control. You can run the tool against a panel set with no conformance to windows theme and with the exact tab control you want to have on the screen. Attached a very simple panel and the corresponding source file generated by the tool.



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 11
(5,161 Views)

Thnak you for your suggestion, I still have not resolved the issue.

I have unchecked the follwing:

- uncheck 'Conform to System Colors'

and

- uncheck 'Use Windows Visual Styles for Controls'

 

But, I the issue is that I need  to have a "flat button", as shown in the figure I have attached in the first post.

When the  "Use Windows Visual Styles for Controls" is unchecked, the button is "not flat", which is not needed.

Is there a way to have a "flat button", with still controling the colors of the objects?

Thak you so much for your answer.

Best regards,

--

Hapiest

0 Kudos
Message 6 of 11
(5,146 Views)

What about my earlier suggestion (You might want to try the 'Classic Style' controls)?

0 Kudos
Message 7 of 11
(5,143 Views)

It is much better with the 'Classic Style', but I see reliefs(delimitation of the button with an other color) in the borders of the 'Classic Style' button. I woul like to have a flat button, wich have same proporeties as the Panel insered in.

As you see in the Figure 1, there is some reliefs in the borders of the button, but it is  much better than the button in Figure 2 (file attached).

Is there a way to move out reliefs of the button in figure 1 (the button with the "Classic style")?

Thank you in advance for your answer.

Best regards,

--

hapiest

 

0 Kudos
Message 8 of 11
(5,120 Views)
Solution
Accepted by topic author hapiest

... if there is no relief how will you know that there is a button and not just a label?

 

In any case you could change the color of the button to transparent...

0 Kudos
Message 9 of 11
(5,109 Views)

Thank you so much, It is what I need!

Best regards,

--

hapiest

0 Kudos
Message 10 of 11
(5,105 Views)