- Private Sub Command1_Click()
- CommonDialog1.DialogTitle = "ouvrir un fichier sympatique ..."
- CommonDialog1.Flags = cdlOFNFileMustExist + cdlOFNHelpButton
- CommonDialog1.Filter = "Tous (*.*)|*.*|Fichiers texte (*.txt)|*.txt"
- CommonDialog1.ShowOpen
- If CommonDialog1.FileName <> "" Then 'annuler
- Label1.Caption = CommonDialog1.FileName
- End If
- End Sub
-
- Private Sub Command2_Click()
- CommonDialog1.DialogTitle = "enregistrer un fichier sympatique ..."
- CommonDialog1.Flags = cdlOFNPathMustExist + cdlOFNOverwritePrompt + cdlOFNHelpButton
- CommonDialog1.ShowSave
- If CommonDialog1.FileName <> "" Then 'annuler
- Label2.Caption = CommonDialog1.FileName
- End If
- End Sub
-
- Private Sub Command3_Click()
- CommonDialog1.ShowColor
- Picture1.BackColor = CommonDialog1.Color
- End Sub
-
- Private Sub Command4_Click()
- CommonDialog1.Flags = cdlCFBoth
- CommonDialog1.ShowFont
- Label3.Font.Bold = CommonDialog1.FontBold
- Label3.Font.Italic = CommonDialog1.FontItalic
- Label3.Font.Name = CommonDialog1.FontName
- Label3.Font.Size = CommonDialog1.FontSize
- Label3.Font.Strikethrough = CommonDialog1.FontStrikethru
- Label3.Font.Underline = CommonDialog1.FontUnderline
- End Sub
Private Sub Command1_Click()
CommonDialog1.DialogTitle = "ouvrir un fichier sympatique ..."
CommonDialog1.Flags = cdlOFNFileMustExist + cdlOFNHelpButton
CommonDialog1.Filter = "Tous (*.*)|*.*|Fichiers texte (*.txt)|*.txt"
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then 'annuler
Label1.Caption = CommonDialog1.FileName
End If
End Sub
Private Sub Command2_Click()
CommonDialog1.DialogTitle = "enregistrer un fichier sympatique ..."
CommonDialog1.Flags = cdlOFNPathMustExist + cdlOFNOverwritePrompt + cdlOFNHelpButton
CommonDialog1.ShowSave
If CommonDialog1.FileName <> "" Then 'annuler
Label2.Caption = CommonDialog1.FileName
End If
End Sub
Private Sub Command3_Click()
CommonDialog1.ShowColor
Picture1.BackColor = CommonDialog1.Color
End Sub
Private Sub Command4_Click()
CommonDialog1.Flags = cdlCFBoth
CommonDialog1.ShowFont
Label3.Font.Bold = CommonDialog1.FontBold
Label3.Font.Italic = CommonDialog1.FontItalic
Label3.Font.Name = CommonDialog1.FontName
Label3.Font.Size = CommonDialog1.FontSize
Label3.Font.Strikethrough = CommonDialog1.FontStrikethru
Label3.Font.Underline = CommonDialog1.FontUnderline
End Sub