FontBold, FontItalic, FontName, FontSize, FontStrikeThru, FontUnderline, FontOutline, FontShadow
These properties control the font characteristics of forms and controls. FontBold, FontItalic, FontStrikeThru and FontUnderline are all logical—.T. means the control's text should use that font characteristic. FontOutline and FontShadow don't do anything in VFP/Windows, though they control the specified font characteristics in VFP/Mac.
Usage |
oObject.FontBold = lBoldValue lBoldValue = oObject.FontBold oObject.FontItalic = lItalicValue lItalicValue = oObject.FontItalic oObject.FontName = cNameValue cNameValue = oObject.FontName oObject.FontSize = nSizeValue nSizeValue = oObject.FontSize oObject.FontStrikeThru = lStrikeThruValue lStrikeThruValue = oObject.FontStrikeThru oObject.FontUnderline = lUnderlineValue lUnderlineValue = oObject.FontUnderline |
ThisForm.edtSample.FontBoldThere's only one complication on this form. Spinners don't update their ControlSource until you leave, so instead the InteractiveChange method of the spinner contains the following line:
ThisForm.edtSample.FontSize=this.Valuewhich updates the sample right away.
Figure 1: Font Characteristics Form.
Example |
* Set an object to use 12-point Courier New Italic This.FontName="Courier New" This.FontSize=12 This.FontBold=.F. This.FontItalic=.T. This.FontStrikeThru=.F. This.FontUnderline=.F. |
See Also |
AFont(), DynamicFontBold, DynamicFontItalic, DynamicFontName, DynamicFontOutline, DynamicFontShadow, DynamicFontSize, DynamicFontStrikeThru, DynamicFontUnderline, GetFont() |