The information in this article applies to:
SYMPTOMSIf you have "TrueType fonts only" set in the Fonts applet in the Windows Control Panel, when you execute Visual Basic code that sets a Fontname property of a form or control to "MS Sans Serif" (or any other non-TrueType font), the program generates error 380: This error can also be generated when you execute the following statement if the FontName property of the Form is a Non-TrueType font (which it is by default): This is true even though the default FontName value is MS Sans Serif. This is because the FontName property is set by default to a non-TrueType font. If you change the FontName property to Arial at design time, you will not get the "Invalid property Value" error, because Arial is a TrueType Font CAUSEMS Sans Serif is the default font for every control created in Visual Basic. Visual Basic does not detect the 'True Types only' setting in the Fonts applet and is, therefore, unaware of the fact that "MS Sans Serif" is an invalid font choice. When the program causes an assignment of the Fontname, Visual Basic is bound to the 'True Types only' setting and rejects any Fontnames not on the list. RESOLUTIONIf you need to set your Fontname property, you can guarantee that the font chosen is valid by stepping through the Screen.Fonts collection with this code:
STATUSThis behavior is by design. MORE INFORMATIONSteps to Reproduce Behavior
Additional query words: 4.00 vb4win vb4all
Keywords : |
Last Reviewed: August 31, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |