image dans bouton vba

motard59

XLDnaute Junior
bonjour
je voudrais incremanter une image appartenent à une cellule dans un bouton vba
merci pour tout
 

motard59

XLDnaute Junior
Re : image dans bouton vba

bonsoir
merci pour cette piste mais ce n est pas ce que je cherche je cherche quelque chose comme ca mais avec une image qui ce trouve sur la feuille à cote du nom
CommandButton1.Picture = LoadPicture("D:\Users\Alain\Pictures\serre\az.jpg")
merci
 

forsanta

XLDnaute Nouveau
Re : image dans bouton vba

ici les image sont stocker directement sur l'userform

' on remplit imagelist1 avec les image
ImageList1.ListImages.Add , , Image1.Picture ' option
ImageList1.ListImages.Add , , Image2.Picture ' en attente
ImageList1.ListImages.Add , , Image3.Picture ' present
ImageList1.ListImages.Add , , Image4.Picture ' present payer

' 1 étant ici le numero d'index de l'image voulut dans le controle imaglist1 soit l'image option
CommandButton1.Picture = ImageList1.ListImages(1).Picture

ce tuto est bien fait pour apprendre a s'en servir ftp://ftp-developpez.com/silkyroad/VBA/ImageList/ImageList.pdf
 
Dernière édition:

motard59

XLDnaute Junior
Re : image dans bouton vba

bonsoir
ta solution est pas mal j ai eu du mal mais ca fonctionnemais pas compatible avec la fonction suivante
'mode plein ecran
Dim ctl As Control
Dim ratiow As String
Dim ratioh As String
ratiow = Application.Width / Me.Width
ratioh = Application.Height / Me.Height
Me.Left = 0
Me.Top = 0
Me.Width = Application.Width
Me.Height = Application.Height
For Each ctl In Me.Controls
ctl.Left = ctl.Left * ratiow
ctl.Top = ctl.Top * ratioh
ctl.Width = ctl.Width * ratiow
ctl.Height = ctl.Height * ratioh
ctl.FontSize = ctl.FontSize * ratioh
Next
 

Discussions similaires