LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CUSTOM MADE BUTTONS

Solved!
Go to solution

Hello,

 

Is it possible to create custom made command buttons and use them in LabWindows CVI.

I am not talking about picture buttons. I tried those and you are very limited making the shape of the button. You can put a picture inside the button but you can not change the shape.

Thanks

0 Kudos
Message 1 of 8
(3,713 Views)

Hi bobby_y,

 

Does your main question have to do with being able to resize the picture button? If so, under control appearance, you can click the Image button and open up the Edit Pictures window as shown below. You should be able to change the Fit Mode setting to allow the picture button to size the image to the control

 

Resize Picture Button.png

 

 

 

Applications Engineering
National Instruments
0 Kudos
Message 2 of 8
(3,674 Views)

Hello,

No it does not. I know how to change the size of a button. I need to create custom made buttons. The closest I got was to use picture buttons. But they have sharp edges and the

picture does not cover all the button. you can still see the edges.

 

Thanks

0 Kudos
Message 3 of 8
(3,655 Views)

The button itself can be painted in transparent so that is shows only the picture. The highlight when it is active, though, will continue to be the overall rectangle.

Painting in transparent can be a problem if you have windows visual styles enabled, but there is a trick for that if you need to.



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 4 of 8
(3,640 Views)

bobby_y: I'm intrigued by your question. To clarify, exactly what features are you looking for?  You mention the edges but it is still not clear.  For example:

  • Non-rectangular shapes? (let's ignore rounding corners here - just the basic shape)
  • Different button style (e.g. flat vs pseudo-3d features, like curvature & shadows)
  • Text that can be managed programmatically like a regular button?
  • Color schemes / transparency?

I'm interested because some of these features can help make a UI look more modern or fit better with another suite of software.  I'm often asked to make things look ... hmmm how shall I say it ... less like instrumentation.

Message 5 of 8
(3,614 Views)

Hello,

I have been using CVI for over 15 years now and have been trying to use it every where I can. But unfortunately when I compare the button, icons or anything graphic, it does not come close to what is out there. Now days the icons and buttons used in applications are very modern, sharp and pleasing. The CVI graphics is really outdated. It can be used for industrial applications but not for VIP and high end visual  applications.

Have you seen the buttons and icons used in home display panels. These panels are used to communicate with stereo system, TV, lights and so on. The graphics and icons are very nice and pleasing. Even the background seems to be a moving cloud.

So I am trying to somehow use CVI buttons to create a similar effect. But have not been able to.

Thanks

 

0 Kudos
Message 6 of 8
(3,608 Views)
Solution
Accepted by bobby_y

Hello,

I was able to do this with a couple tricks. I generated a useless arrow using PaintShop Pro with a transparent background. While the picture was active, I selected it. Then I copied it into the NI Icon editor window using  256 x 256 - 32 bit color.  In LW, I created a picture command button with a transparent background, then loaded the icon file into it, and the rectangular white space does not show up on the panel. When clicking on the arrow, it moves down and to the right a few pix, but no shadowing occurs. The trick I believe is to eliminate the surrounding white space. Because I used an airbrush setting for the black outline, there are white pixels within that path. I would think clean lines would should show up clean.

Arrow Demo.jpg

Message 7 of 8
(3,274 Views)

Thanks.

 

I will try it

0 Kudos
Message 8 of 8
(3,223 Views)