cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Textbox Format Property "Underline"

Raiko
16-Pearl

Textbox Format Property "Underline"

hello folks,

when right clicking on a textbox one can chose on the fonts tab a text effect called "underline". I'd like to access and control this via a program. However, this method is not listed in the developers reference the Textbox Format Properties. Does anybody know whether this can be accessed by some other property or method?

Thanks in advance

Raiko

P.S.

It goes without saying that I'm using MC15

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:Raiko)

TextBox.Font.Underline = 0 or TextBox.Font.Underline = 1

View solution in original post

6 REPLIES 6
RichardJ
19-Tanzanite
(To:Raiko)

TextBox.Font.Underline = 0 or TextBox.Font.Underline = 1

Raiko
16-Pearl
(To:RichardJ)

Thank you Richard. Where did you find this info?

Raiko

RichardJ
19-Tanzanite
(To:Raiko)

I forget where I originally found it. I just know that's how it works

It looks like the textbox might be implementing IFont IFont interface (COM) where the get_/put_ gets dropped for the command. The full com interface for the textbox looks like this in OLEView:

helpstring("Dispatch interface for TextBox Control"),

short Appearance;

short BorderStyle;

VARIANT_BOOL Enabled;

Font* Font;

OLE_HANDLE hWnd;

BSTR Text;

OLE_COLOR BackColor;

OLE_COLOR ForeColor;

VARIANT_BOOL ReadOnly;

VARIANT_BOOL LeftScrollBar;

VARIANT_BOOL HorizontalScroll;

VARIANT_BOOL VerticalScroll;

VARIANT_BOOL AutoHScroll;

VARIANT_BOOL AutoVScroll;

VARIANT_BOOL Lowercase;

VARIANT_BOOL Multiline;

VARIANT_BOOL NoHideSelection;

VARIANT_BOOL Number;

VARIANT_BOOL OEMConvert;

VARIANT_BOOL Password;

VARIANT_BOOL Uppercase;

VARIANT_BOOL WantsReturn;

VARIANT_BOOL TextAlignment;

VARIANT_BOOL Border;

VARIANT_BOOL ClientEdge;

VARIANT_BOOL RightToLeftReadingOrder;

methods:

void Recalculate();

Robert

RichardJ
19-Tanzanite
(To:radair)

That makes sense. There's only two ways I can think of for how I got this information. One is that the MS Forms 2.0 controls (which are much better documented!) use this syntax, so I just guessed, and it worked. Presumably both the Forms 2.0 controls and the Mathsoft controls implement the IFont interface. The other possibility is that I got the information from someone on the old Collaboratory that knows much more about programming than i do, probably either you or Xavier. In which case I punt the question "Where did you find this info"?

The textbox control is in mcformsr.ocx, so it's highly likely that this was a wrapper on the general msforms set of windows controls. If I open up the Microsoft msforms library in oleview, IFONT sits at the top. I haven't browsed the vba help on msforms at msdn, but maybe there are useful examples here Microsoft Forms Visual Basic reference

Robert

Top Tags