Visual Basic Reference

FontBold, FontItalic, FontStrikethru, FontUnderline Properties Example

This example puts text on a form in one of two combinations of styles with each mouse click. To try this example, paste the code into the Declarations section of a form, and then press F5 and click the form.

  Private Sub Form_Click ()
   FontStrikethru = Not FontStrikethru   ' Toggle strikethrough.
   FontItalic = Not FontItalic   ' Toggle font style.
   Print "Now is the time!"   ' Print some text.
End Sub