Accueil > > > REMPLACER AVANTAGEUSEMENT UNE SCROLL BARRE...
REMPLACER AVANTAGEUSEMENT UNE SCROLL BARRE...
Information sur la source
Description
HScrollLabel peut remplacer avantageusement une Scroll barre, il renvoie sa valeur indicative, ne prend pas beaucoup de place, est personnalisable et precis. L'icone affichee sur le control indique la marche a suivre. On peut adapter le principe a une liste ou d'autre types de contrôles (voir l'exemple HScrollListe).
Source
- 'DANS UN MODULE OU DANS LA FEUILLE :
-
- Public dz As Integer, ez As Integer, fz As Integer, gz As Integer, hz As Integer, iz As Integer, jz As Integer
-
- Public Sub HScrollLab(Obj As Object, Button As Integer, X As Single, MinVal As Integer, MaxVal As Integer, Sensibility As Integer)
- Obj.MousePointer = 99
- Obj.MouseIcon = Command1.Picture
- If Button = 0 Then
- hz = 0
- End If
- If Button = 1 And hz = 0 Then
- gz = X
- fz = Obj.Caption
- hz = 1
- End If
- If Button = 1 And hz = 1 Then
- a = CInt((X - gz) / Sensibility)
- b = fz + a
- If b >= MinVal And b <= MaxVal Then
- Obj.Caption = b
- End If
- End If
- End Sub
-
- Public Sub HScrollList(Obj As Object, Id As Integer, Button As Integer, X As Single, MinVal As Integer, MaxVal As Integer, Sensibility As Integer)
- Obj.MousePointer = 99
- Obj.MouseIcon = Command1.Picture
- If Button = 0 Then
- hz = 0
- End If
- If Button = 1 And hz = 0 Then
- gz = X
- fz = Obj.List(Id)
- hz = 1
- iz = Id 'Iz verrouille la variation sur l'index de liste(Id)
-
- End If
- If Button = 1 And hz = 1 Then
- a = CInt((X - gz) / Sensibility)
- b = fz + a
- If b >= MinVal And b <= MaxVal Then
- Obj.List(iz) = b
- End If
- Obj.Selected(iz) = True
- End If
- End Sub
-
- 'DANS UNE FEUILLE :
-
- Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- 'Obj As Object, Button As Integer, X As Single, MinVal As Integer, MaxVal As Integer, Sensibility As Integer
-
- Call HScrollLab(Label1, Button, X, 0, 127, 100)
- End Sub
-
- Private Sub List1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- 'Obj As Object, Id As Integer, Button As Integer, X As Single, MinVal As Integer, MaxVal As Integer, Sensibility As Integer
-
- Call HScrollList(List1, List1.ListIndex, Button, X, 0, 127, 100)
- End Sub
'DANS UN MODULE OU DANS LA FEUILLE :
Public dz As Integer, ez As Integer, fz As Integer, gz As Integer, hz As Integer, iz As Integer, jz As Integer
Public Sub HScrollLab(Obj As Object, Button As Integer, X As Single, MinVal As Integer, MaxVal As Integer, Sensibility As Integer)
Obj.MousePointer = 99
Obj.MouseIcon = Command1.Picture
If Button = 0 Then
hz = 0
End If
If Button = 1 And hz = 0 Then
gz = X
fz = Obj.Caption
hz = 1
End If
If Button = 1 And hz = 1 Then
a = CInt((X - gz) / Sensibility)
b = fz + a
If b >= MinVal And b <= MaxVal Then
Obj.Caption = b
End If
End If
End Sub
Public Sub HScrollList(Obj As Object, Id As Integer, Button As Integer, X As Single, MinVal As Integer, MaxVal As Integer, Sensibility As Integer)
Obj.MousePointer = 99
Obj.MouseIcon = Command1.Picture
If Button = 0 Then
hz = 0
End If
If Button = 1 And hz = 0 Then
gz = X
fz = Obj.List(Id)
hz = 1
iz = Id 'Iz verrouille la variation sur l'index de liste(Id)
End If
If Button = 1 And hz = 1 Then
a = CInt((X - gz) / Sensibility)
b = fz + a
If b >= MinVal And b <= MaxVal Then
Obj.List(iz) = b
End If
Obj.Selected(iz) = True
End If
End Sub
'DANS UNE FEUILLE :
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Obj As Object, Button As Integer, X As Single, MinVal As Integer, MaxVal As Integer, Sensibility As Integer
Call HScrollLab(Label1, Button, X, 0, 127, 100)
End Sub
Private Sub List1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Obj As Object, Id As Integer, Button As Integer, X As Single, MinVal As Integer, MaxVal As Integer, Sensibility As Integer
Call HScrollList(List1, List1.ListIndex, Button, X, 0, 127, 100)
End Sub
Conclusion
J'ai generaliser l'utilisation de ce control dans CORDE VIRTUELLE, une application MIDI comportant d'innombrables parametres. Les boutons tournant et autre curseurs ne sont tres ergonomiques. www.cordevirtuelle.com Did@cordevirtuelle.com
Historique
- 06 octobre 2004 20:01:44 :
- Merci pour la mise en page automatique du code, j'ai pas encore tout compris...
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
XNA IS DEAD!XNA IS DEAD! par richardc
Depuis la semaine dernière (et grâce aux TechDays 2012), je me penche activement sur la nouvelle version de Windows, aka Windows 8. Vous me direz, il était temps puisque la première preview date de Septembre dernier.
OK. Remarquez, on n'en est qu'aux...
Cliquez pour lire la suite de l'article par richardc TECHDAYS PARIS 2012 : WINDOWS SERVER "8" QUOI DE 9 !TECHDAYS PARIS 2012 : WINDOWS SERVER "8" QUOI DE 9 ! par ROMELARD Fabrice
Speakers: Fabrice Meillon et Stanislas Quastana Cette session est basée entièrement sur celle donnée lors de la BUILD cet hiver. Il n'y a pas d'ajout d'information en rapport avec cet évènement passé. Windows 8 Server sera intégralem...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [HTML5] AUTOUR DU W3C : NOUVEAUX STANDARDS ET WEB MOBILE (LILLE)[HTML5] AUTOUR DU W3C : NOUVEAUX STANDARDS ET WEB MOBILE (LILLE) par Gio
Je m'y prends un peu tard je sais, mais bon je suis développeur web et donc hyper fainéant ! Toujours dans le cadre des technologies émergentes, ici HTML5, parce qu'on aime HTML5 chez Wyg , nous seront présent, le vieux ( Aurélien V.) et moi, pour pr...
Cliquez pour lire la suite de l'article par Gio [WP7] DYNAMICALLY CHANGE STARTUP PAGE[WP7] DYNAMICALLY CHANGE STARTUP PAGE par KooKiz
Let's say that you want to allow the user to customize the startup page of your application. You can easily change the startup page by editing the 'NavigationPage' attribute in the manifest file. But the manifest cannot be modified once the applicatio...
Cliquez pour lire la suite de l'article par KooKiz
Logiciels
DocTranslate (V3.1.0.0)DOCTRANSLATE (V3.1.0.0)DocTranslate est un traducteur de document Microsoft Word, PowerPoint et Excel. Il permet d'autom... Cliquez pour télécharger DocTranslate Tribler (2012)TRIBLER (2012)Tribler est un client pair à pair (P2P/Peer-to-Peer) open source avec la capacité de regarder des... Cliquez pour télécharger Tribler OneSwarm (2012)ONESWARM (2012)Le peer-to-peer qui protège votre vie privée, c'est OneSwarm.
Ce logiciel de peer-to-peer crypté... Cliquez pour télécharger OneSwarm PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System
|