sitetrio.blogg.se

Font face microsoft sans serif
Font face microsoft sans serif






font face microsoft sans serif

And, in many cases, no font name is specified at all (defaulting to MS Sans Serif).

#Font face microsoft sans serif code

The first part was addressed in an earlier thread, and was the start of the code shown in post #2.įor the first part, the problem is that we're talking about hundreds of forms. If InStr (ctl.RTFCode, "MS Sans Serif" ) ThenĬtl.RTFCode = Replace$ (ctl.RTFCode, "MS Sans Serif", "Microsoft Sans Serif" ) If TypeName (ctl ) = "RtfButton" Or TypeName (ctl ) = "RtfLabel" Then ' And now deal with the RtfButton and RtfLabel.

font face microsoft sans serif

On Error Resume Next ' Not all controls have a font property. If you're further interested in how they work, here's the link to the codebank.Ĭode: Public Sub ReplaceMsFonFont (frm As Form ) ' This replaces "MS Sans Serif" with "Microsoft Sans Serif" wherever it's found on the form.įrm.Font.Name = "Microsoft Sans Serif" ' From all I can tell, this is VERY close to the same width characters (per font size).įrm.Font.Name = "Times New Roman" ' Times New Roman is a bit narrower, but there is no Microsoft Serif, and I don't use Serif fonts much. It truly allows me great flexibility in placing formatted text on a VB6 form:ĮDIT2: Also, I placed these controls in the codebank (with example) about a year ago. On the following, except for the two buttons, that's all one RtfLabel. I'll continue working though.ĮDIT1: Just for an example, here's a way that I use that RtfLabel control. But I'm still certainly willing to listen to ideas. Maybe, by writing it out here, I've outlined the solution. I need a procedure that runs in Form_Load that searches for these two controls (RtfButton and RtfLabel), finds their text, examines whether or not it contains MS Sans Serif, and, if it does, swap it out for Microsoft Sans Serif. Here's a hex-editor's snooping of an "asdfasdfasd" caption for the RtfLabel control I used for testing: FRX file of a form with this UserControl. I've looked, and this property is stored in the. Within the UserControl, this text is actually managed in a module variable named m_RTFCode (a string), and it's stored as a property named RTFCode. I've examined things, and the RTF caption text is just stored in the TextRTF property of the RTB that's part of the UserControl. (Ok ok, my bad back in 1999.) And now, this font is scattered throughout where these controls are used (which is extensive). This control has always defaulted to the MS Sans Serif font. When in design mode, there's a little editor that can pop up (when "Edit" is clicked on the context menu of the control) which allows you to type (or Copy-Paste from WordPad) text that's "rich". As you might guess, they're just controls that allow RTF text on a button or label caption. I've got these two UserControls I've used for decades (and wrote a LONG time ago). Just as an FYI, I'm talking about 100s of forms, so source code editing isn't a good choice. Okay, for the most part, things are going fine with me swapping out MS Sans Serif with Microsoft Sans Serif during runtime (allowing me to avoid a huge source code editing job).








Font face microsoft sans serif