LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting text output to a textbox

Hello,
I'm using LabWindows 6.0. I'm writing data to a text box and would like to know if the
text  can be formatted in  different colors/bold/etc.
 
All help is appreciated.
Thanks,
Swati
 
0 Kudos
Message 1 of 10
(5,193 Views)
You cannot format text in a textbox: the whole control inherits formatting given to it in the UIR editor or programmaticaly in your program.
 
If you can organize your output in rows, you could think to use a listbox intead: in this control you can format up to individual characters with different background and foreground colors, organize the output in columns and give columns right-, center- or left-alignment.
 
Online help for InsertListItem command give you all informations about text formatting.


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 2 of 10
(5,185 Views)

Hello Swati,

Along the lines of what Roberto said, here is an example showing how to insert colored items in a listbox.  Also, you might want to look into use the RichTextBox ActiveX control, which allows you change color, formatting and other settings for text entries.  This RichTextBox example demonstrates how to do this.

Thanks.

Message Edited by Wendy L on 07-14-2005 04:52 PM

Message Edited by Wendy L on 07-14-2005 04:53 PM

Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 3 of 10
(5,186 Views)
You may not be able to use the Microsoft RichText Box ActiveX control if you do not have Visual Studio installed. The development version of this ActiveX control comes only with certain MS development tools such as Visual Studio.
 
Scott Y
NI
0 Kudos
Message 4 of 10
(5,168 Views)
That is why I am always suspicious in using ActiveX controls. Well... "suspicius" is not the exact concept: I'm full of
(often unresolved) question marks.
 
I was able to run Wendy's example on my machine on which no version of Visual Studio was never installed (but it is Office in its professional version, for example), so why does it work? And will it work on my customer's machine if I deploy such application to him? Or which licence does he need to use this ActiveX (if he does need one): does he need to install Visual Studio only to use a single RichTextBox? Or maybe some version of Office or whichever other product?
 
Answers to these questions are not always easy to find, and I'm not always able to test a product directly on the customer's machine or duplicate the same environment on a computer of mine (besides it, what will happen if and when my customer will change its computer?) so I adopted the policy of limiting the use of external components to the minimum possible (possibly none of them): it may be limiting my possibilities but it saves me a lot of painSmiley Surprised


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 5 of 10
(5,154 Views)
I do agree with Roberto, except for NI ActiveX Controls.
Regards,

0 Kudos
Message 6 of 10
(5,135 Views)
The way that I go about using/distributing ActiveX controls is to use a laptop that has basically windows XP installed on it and nothing else.  I then run my GUI to find out what kind of (less obvious) problems there may be with activeX controls.  I then download the appropriate activeX component install files when necessary.  I also try to use the earliest possible version of the controls (i.e. WMP 6.1 instead of WMP 10.0 to try and ensure compatability).  I usually end up using a professional distribution kit like InstallShield when distributing software because it is much more robust when the issue of installing external executables comes up.
0 Kudos
Message 7 of 10
(5,110 Views)
I also wanted to do the same.
 
Maybe it's time for a new feature request
😄
 
I suspected that it was eiother impossible or rather difficult to accomplish.  So I stayed with the basic formatting.
 
JLV

Message Edited by JoeLabView on 07-19-2005 10:36 PM

Message 8 of 10
(5,095 Views)

Hello,

 KB 163183 at MSDN has some good information about what files are needed to suppport specific MS ActiveX controls.

You can use the distribution kit in CVI to automatically install these files and register them as ActiveX controls.

Scott Y

NI

0 Kudos
Message 9 of 10
(5,064 Views)

Thanks Scott!

I will try it and provide feedback.

JLV

0 Kudos
Message 10 of 10
(5,052 Views)