01-25-2019 03:50 PM
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
Solved! Go to Solution.
01-26-2019 06:15 AM
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.
01-26-2019 07:55 AM
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
02-18-2019 07:24 AM
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.
02-19-2019 02:35 PM
hi DBCepull
Your suggestion works perfectly; probably better than messing around with a TEXTBOX.
thank you, thank you, thank you