LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Rich Text Box - Default Font Color?

I'm trying to add a Rich Text Box (the ActiveX 6.0 SP4 version) to my project. I'm using CVI 7.1.

The problem I'm running into is changing the default font color. I can change the background. Why can't I change the foreground in the font setup screen? Trying to change the font color does nothing. What do I need to do?

(I saw the tip about changing the control from "OPERATE" to "EDIT".)


I've attached a screen shot showing what I'm trying to do.
0 Kudos
Message 1 of 5
(5,975 Views)

I don't know why you can't set the default color in the UI editor. It seems to be a problem with the control.

However, you can set it at runtime. Check out the richTextbox sample program in \samples\userint\activex to see how to set it programmatically.

Hope this helps,

- jared

Message 2 of 5
(5,940 Views)
Jared,

I don't have that example. It must be a CVI 8.0 example. I only  have 7.1.

Can you post a snippit?
0 Kudos
Message 3 of 5
(5,857 Views)
After looking high and low, I finally figured it out.

The RTF control does not have a ForeColor property like it has a BackColor property.

Instead, it has a SelColor property.

When used without a selection, SelColor changes the color going forward.
0 Kudos
Message 4 of 5
(5,850 Views)
Here is the rich text sample program. It was introduced in 8.1.
0 Kudos
Message 5 of 5
(5,823 Views)