LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

flashing button

Hi,
 
I use Labwindows CVI 8.1 Demonstration version and I need to create some command buttons which flashes when i want.
I thought to change the background color with a command button control attribute but I didnt found the good one. I used "ATTR_CMD_BUTTON_COLOR" but the result is not what I'm looking for. Indeed the background color is the same and the button must be selected to see the color change.
 
Could you help me please ?
Thanks a lot in advance for your help !
 
Nicolas Vitale
0 Kudos
Message 1 of 3
(3,402 Views)
Hello Nicolas,

There are two things to keep in mind:

1. If your panel has the "Use Windows Visual Styles for Controls" option turned on (to see if you do, click on "Other Attributes" from the Edit Panel dialog box), then you cannot change the color of command buttons in this panel, since that would conflict with the purpose of this option. If you're in this situation, and you don't want to turn off the option for the entire panel, you can turn it off only for this one command button, by making the following call:

    SetCtrlAttribute (panelHandle, PANEL_COMMANDBUTTON, ATTR_DISABLE_PANEL_THEME, 1);

2. After you change the value of an attribute, you have to allow CVI to process system events in order to see the change. This is normally automatic, if you make the change inside some callback function that doesn't execute for very long. In that case, as soon as your code leaves the callback, and returns to the RunUserInterface loop, events will be processed, and you will see your change. However, if you are running a lot of code after the attribute change, you might have to wait a long time before you see your change. If this is your situation, you might have to add a ProcessDrawEvents call in order to see your change earlier.

Luis

Message 2 of 3
(3,396 Views)

Hello Luis,

thanks a lot for your answer. The problem is solved.

Nicolas.

0 Kudos
Message 3 of 3
(3,382 Views)