LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

BOLD or UNDERLINE certain words in a TEXTBOX

Solved!
Go to solution

I would like to bold or underline just certain words in a TEXTBOX in CVI 17.  I have tried to read in an .rtf file.  that didn't work.  Also tried writing escape sequences to a NOTEPAD text file.  had trouble getting the esc sequences written so not sure if that would work.  The Text Style option seems to only work for all text in the TEXTBOX and that is not what I want.  

My goal is to highlight certain words within the TEXTBOX

thanks

0 Kudos
Message 1 of 5
(4,695 Views)
Solution
Accepted by topic author willlg

Hello, unfortunately the textbox control, as you already have found, only accepts formatting valid for the entire control. You could try moving to a listbox control that permits you to highlight some text in with both foreground and background colors (but lacks the bold attribute, thouugh).

Otherwise you can experiment with the ActiveX Rich Textbox control which permits all the highlighting you are listing at the cost of a more complex programming. CVI comes with a full example of Rich Textbox using: you can find it by searching for "Rich" in the Example Finder (Help >> Find Examples... menu option). There are also a few discussions about that control that you may search for in this forum board.



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 2 of 5
(4,666 Views)

ok, I will look into a LISTBOX, but I think that I need more flexibility.  No to ActiveX since I need to keep the application small and not require much in the way of resources from the target PC.

For the moment, I have decided to use a hard copy of a Word doc.  The intention was to have a "help page" in something I am working on to explain and generate algebraic equations to solve.  I tutor high school math and to have a hardcopy help page may be a better idea anyway.

Regardless, thanks for your thoughts Roberto

0 Kudos
Message 3 of 5
(4,659 Views)

willlg,

For help files, I use Word to create the document, and then save the document as a "Single File Webpage", (mht file). You can then open this file using the local default browser, (everyone should have that). Use the following LW/CVI command from the Programmer's Toolbox:

 

OpenDocumentInDefaultViewer (<docfilename>, VAL_NO_ZOOM);

 

Anything that you can display and format in a Word doc can be presented.

Message 4 of 5
(4,491 Views)

hi DBCepull

Your suggestion works perfectly; probably better than messing around with a TEXTBOX.

thank you, thank you, thank you

0 Kudos
Message 5 of 5
(4,477 Views)