Format texte bouton VBA

Bonjour je cherche comment modifier le format du texte d'un bouton

Private Sub UserForm_Activate()

UserForm1.CommandButton11.Caption = "Presse" & Chr(10) & "Papier"

End Sub

Merci Bon dimanche

Bonjour Arnaud, bonjour le forum,

Oui mais quel est ton problème ?!... Si je reprends ton code j'ai bien un CommandButton11 avec comme caption :

Presse

Papier

sur deux lignes...

je cherche a modifier le format du non du bouton car par défaut il prend (10) je crois

le nom presse et papier en gras en plus gros

Merci

Re,

Pour la taille de la police et ses attributs, il faut voir la propriété Font du CommandButton. Mais avoir deux tailles différentes sur le même bouton, pas sûr que tu puisses le faire...

Bonjour toutes et tous

Coucou ThauThème

vite fait avec 3 boutons de commande:

Option Explicit

Private Sub CommandButton1_Click()
' btn fermer
Unload Me
End Sub

Private Sub CommandButton12_Click()
Dim nom
If UserForm1.CommandButton11.Caption = "" Then msgbox " le nom de ce bouton est vide! "

 If msgbox("Etes-vous certain(e) de vouloir modifier le nom de ce bouton de commande ?", vbYesNo, "Demande de confirmation") = vbYes Then

  nom = InputBox("nom du bouton?", "nom")
    UserForm1.CommandButton11.Caption = nom
    Else
    msgbox "Annulé par l'utilisateur"
    Exit Sub
    End If

End Sub

Private Sub UserForm_Activate()
UserForm1.CommandButton11.Caption = "Presse" & Chr(10) & "Papier"
UserForm1.CommandButton11.Font = "Comic sans MS"
UserForm1.CommandButton11.Font = "Bold"
UserForm1.CommandButton11.FontSize = "17"
UserForm1.CommandButton11.AutoSize = True
If UserForm1.CommandButton11.Caption = "" Then msgbox " le nom de ce bouton est vide! "
Exit Sub

 If msgbox("Etes-vous certain de vouloir changer le nom de ce bouton de commande ? par :" & Chr(10) & "Presse" & Chr(10) & "Papier", vbYesNo, "Demande de confirmation") = vbYes Then

UserForm1.CommandButton11.Caption = "Presse" & Chr(10) & "Papier"
    Else: Exit Sub
End If
End Sub

ci-joint,

crdlt,

André

merci beaucoup

je voulais juste cette fonction pour résoudre mon problème qui fonctionne Maintenant Merci je garde ton fichier exemple

Bonne journée

UserForm1.CommandButton11.Font = "Comic sans MS"

UserForm1.CommandButton11.Font = "Bold"

UserForm1.CommandButton11.FontSize = "17"

UserForm1.CommandButton11.AutoSize = True

Re,

De rien Arnaud34 avec grand plaisir bon Dim à toi aussi ainsi qu'à toutes et tous.

Rechercher des sujets similaires à "format texte bouton vba"