Skip to main content

RichTextBox QControl


The RichTextBox QControl Code can be found here:

RichTextBox QControl.zip


The QControl Toolkit is required to use this and can be found here:

The QControl Toolkit on LabVIEW Tools Network



Overview


For this QControl I wanted a completely LabVIEW Rich Text Box.  Under the hood it uses an HTML-like tagged string to define the formatting.  Then there are two main methods: one that converts the tagged string to the formatted string and one that converts the formatted string to the tagged string.

This QControl contains two classes.  First, the RichTextBox Class inherits from the String Class and adds the ability read/write through a property nodes:

  • the tagged string 
  • whether to view the tagged string value or the formatted value in the String Control

Second, the RichTextBoxWithToolbar adds the Toolbar Facade and the Event Handler to handle all of the formatting events.  The font list is populated based on the OS and there is a case structure for that in the Initialize Control Method in this class.

See the included tester VI for implementation details.

Comments

  1. This is awesome.......Can we add functionality to add Image into it

    ReplyDelete
    Replies
    1. Unfortunately, no. The RichTextBox QControl extends the standard string control. So, it has no way it could handle images as it is written.

      You could, however, create a QControl from a picture control. Then program it to act like a sting which allows images. It would be difficult but not impossible to do.

      Other QControl resource can be found in the following links:

      https://www.qsi.dev/articles/
      https://labviewwiki.org/wiki/QControl
      https://forums.ni.com/t5/QControl-Enthusiasts/gh-p/5383?profile.language=en
      https://www.vipm.io/package/qsi_qcontrol_toolkit/

      Delete

Post a Comment

Popular posts from this blog

StatusHistory QControl

This is the second in a series of posts on some of the extended QControls that come already installed with the QControl Toolkit.  There is no separate download for these.  To get them just install the QControl Tool Kit available here: The QControl Toolkit on LabVIEW Tools Network After installed, examples can be found in the NI Example Finder and the Controls (Facades) and the methods can be found in the Addons-->QControl Palettes. Overview The StatusHistory QControl is a history stack which will display the last number of strings written to it.  The history size, colors, and direction are settable properties. The StatusHistory QControl is what I used in the New QControl Wizard to get the cool vanishing text effect.  There is an example in the Example Finder (shown below) when the toolkit is installed. Pictured here and in the New QControl Wizard I set the older strings in the stack to fade to the same color as my background to make the disappearing effect.  Ho

Steps QControl

This is the fourth in a series of posts on some of the extended QControls that come already installed with the QControl Toolkit.  There is no separate download for these.  To get them just install the QControl Tool Kit available here: The QControl Toolkit on LabVIEW Tools Network After installed, examples can be found in the NI Example Finder and the Controls (Facades) and the methods can be found in the Addons-->QControl Palettes. Overview The Steps QControl handles the pages in a Tab Control to aid in making step-by-step wizards.  It is used in the QControl Creation Wizard given as part of the QCtonrol Toolkit, shown below: In the Steps QControl Class there are three public methods: Goto Start Method - Enables the first page, disables all the other pages, and sets the Tab Control to the first page. Next Method - Enables the next page, disables all the other pages, and sets the Tab Control to the next page. Back Method - Enables the previous page, disables all t