ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

changing text colour

Hi,

 

How do i change the color of text when show connect & normal color when disconnect??

Attach with vi here.

 

Thanks and Regards,

Simon 

0 件の賞賛
メッセージ1/6
2,968件の閲覧回数

You are basically pointed in the right direction. You just need to update the contents of the indicator before you start manipulating the colors. Also you need logic to set the color for the disconnect cases.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 件の賞賛
メッセージ2/6
2,953件の閲覧回数

Hi Mike,

 

Thanks to reply.

Why execute one time, the "connect" still show normal color & need to execute again to take effect??

 

simon

0 件の賞賛
メッセージ3/6
2,942件の閲覧回数

Turn on execution highlighting and I believe that you'll see that the problem is that the string 2 value is being updated after the colors are set. The colors will change as they should until the text changes, at which time the color of all the text changes back to the indicator's default text color. As I said in my earlier post, make sure the indicator updates before changing any of the colors and you should be fine.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 件の賞賛
メッセージ4/6
2,939件の閲覧回数

Hi,

 

I still not clear the Update the indicator as you mentioned, but i work out as show in my attachment & still the same.

 

thanks and regards,

Simon

0 件の賞賛
メッセージ5/6
2,933件の閲覧回数

What I mean is that the code first sets all the colors and then after that is all done, writes the string value to the indicator outside the case structure. Rearrange the code such that you write the string to the indicator before you manipulate any of the colors. Also the property you added has no effect because string 2 is an indicator. It is only for controls and it does something completely different.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 件の賞賛
メッセージ6/6
2,926件の閲覧回数