Les fameuses scrollbars

Résolu
CYBOR2000 Messages postés 31 Date d'inscription samedi 19 février 2005 Statut Membre Dernière intervention 9 mars 2007 - 22 mai 2005 à 15:16
CYBOR2000 Messages postés 31 Date d'inscription samedi 19 février 2005 Statut Membre Dernière intervention 9 mars 2007 - 9 mars 2007 à 22:58
voilà mon problème :
j' ai une picturebox, et un vscrollbar à droite, et un hscrollbar en bas.
comment faire pour faire défiler l' image dedans, une photo beaucoup trop grande comparé à la taille de ma picturebox, et sans rajouter un contrôle image à l' intérieur
c'est très urgent pour un projet
merci de vos réponses claires et précises


-cybor-

4 réponses

CYBOR2000 Messages postés 31 Date d'inscription samedi 19 février 2005 Statut Membre Dernière intervention 9 mars 2007
23 mai 2005 à 19:50
ça marche à perfection ! merci beaucoup


-cybor-
3
jpleroisse Messages postés 1788 Date d'inscription mardi 7 novembre 2000 Statut Membre Dernière intervention 11 mars 2006 27
22 mai 2005 à 20:00
Bonsoir,

Essaye ce code, il te faudra changer suivant la grandeur de ton Picture et ton Image les Max et Min.



Private Sub Form_Load()

VScroll1.LargeChange = 100

VScroll1.Max = 3750

VScroll1.Min = 1600

VScroll1.SmallChange = 50

HScroll1.LargeChange = 100

HScroll1.Max = 3750

HScroll1.Min = 1600

HScroll1.SmallChange = 50

End Sub



Private Sub HScroll1_Change()

Image1.Width = HScroll1.Value

Image1.Left = (Picture.Width / 2) - (Image1.Width / 2) - 300

End Sub



Private Sub HScroll1_Scroll()

Call HScroll_Change

End Sub



Private Sub VScroll1_Change()

Image1.Height = VScroll1.Value

Image1.Top = (Picture.Height / 2) - (Image1.Height / 2) - 300

End Sub



Private Sub VScroll1_Scroll()

Call vsCroll_Change

End Sub



jpleroisse
0
Gobillot Messages postés 3140 Date d'inscription vendredi 14 mai 2004 Statut Membre Dernière intervention 11 mars 2019 34
22 mai 2005 à 21:50
Option Explicit



Dim Sx As Long

Dim Sy As Long

Dim Lx As Long

Dim Ly As Long



Private Sub Form_Load()

Picture1.ScaleMode = 3

Lx = ScaleX(Picture1.Picture.Width, vbHimetric, vbPixels)

Ly = ScaleY(Picture1.Picture.Height, vbHimetric, vbPixels)

Sx = Picture1.ScaleWidth

Sy = Picture1.ScaleHeight

HScroll1.Max = Lx - Sx

VScroll1.Max = Ly - Sy

End Sub



Private Sub HScroll1_Change()

Edition

End Sub



Private Sub HScroll1_Scroll()

Edition

End Sub



Private Sub VScroll1_Change()

Edition

End Sub



Private Sub VScroll1_Scroll()

Edition

End Sub



Private Sub Edition()

Picture1.PaintPicture Picture1.Picture, 0, 0, Sx, Sy, HScroll1.Value, VScroll1.Value, Sx, Sy

End Sub


Daniel
0
CYBOR2000 Messages postés 31 Date d'inscription samedi 19 février 2005 Statut Membre Dernière intervention 9 mars 2007
9 mars 2007 à 22:58
ps : je m'auto accepte car les 2 sources sont biens chpe pa choisir

-cybor-
0
Rejoignez-nous