ThumbCaptionColor Example VB

This example shows how the Common Font dialog can be used to set the font characteristics for the thumbnail caption.

Private Sub cmdSetCaptionFont_Click()    
    On Error GoTo Err_Handle    
    'Display the Font dialog box
    CommonDialog1.CancelError = True
    CommonDialog1.Flags = cdlCFBoth Or cdlCFEffects 'Enable all fonts and effects
    CommonDialog1.ShowFont     
    Set cptFont = ImgThumbnail1.ThumbCaptionFont    
    'Font characteristics returned from Font dialog
    With cptFont
        .Name = CommonDialog1.FontName
        .Size = CommonDialog1.FontSize
        .Bold = CommonDialog1.FontBold
        .Italic = CommonDialog1.FontItalic
        .Underline = CommonDialog1.FontUnderline
        .Strikethrough = CommonDialog1.FontStrikethru
    End With    
    ImgThumbnail1.ThumbCaptionFont = cptFont    
    'Caption color is also set in Font dialog
    ImgThumbnail1.ThumbCaptionColor = CommonDialog1.Color
    Exit Sub    
Err_Handle:
    MsgBox Err.Description, , "Error"
    Exit Sub    
End Sub