begin process at 2012 02 13 23:38:08
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Control

 > REMPLACER AVANTAGEUSEMENT UNE SCROLL BARRE...

REMPLACER AVANTAGEUSEMENT UNE SCROLL BARRE...


 Information sur la source

Note :
8 / 10 - par 1 personne
8,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Control Niveau :Débutant Date de création :06/10/2004 Date de mise à jour :06/10/2004 20:01:44 Vu / téléchargé :5 294 / 359

Auteur : ying

Ecrire un message privé
Site perso
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

Cliquez pour voir la capture en taille normale
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

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 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

Source avec une capture TEXTE TO SPEECH MAISON OU ALPHI
Source avec Zip DÉPLACEMENT DE FEUILLES SANS BARRE DE TITRE AVEC UN MODUL
Source avec Zip PARAMETRES UTILISATEUR
Source avec Zip Source avec une capture A CUSTOM VIRTUAL KEYBOARD
Source avec Zip DEPLACER UNE FEUILLE SANS BARRE DE TITRE OU UN OBJET, REDUIR...

 Sources de la même categorie

Source avec Zip COMMUNICATION MODBUS MASTER par sergelapointe
Source avec Zip Source avec une capture DÉPLACEMENT AVEC FLÈCHES DANS UN PAVÉ DE TEXTBOX 9X9 DYNAMIQ... par EhJoe
Source avec Zip Source avec une capture Source .NET (Dotnet) CONTROLSTARS EN RÉPONSE À JAKNIGHT007 par bigboss9
Source avec Zip Source avec une capture Source .NET (Dotnet) CALENDRIER ANNUEL NORME ISO par Prog1001
Source avec Zip Source avec une capture Source .NET (Dotnet) CONTROLE STARS par jaknight007

Commentaires et avis

Commentaire de jmlucienvb le 07/10/2004 08:44:10

Sympa, juste à préciser qu'il faut faire glisser la souris dans le sens des flèches du curseur...
Bon c'est vrai j'suis pas bien réveillé !!
je mets une note 8/10 pour l'idée...

Commentaire de trabice le 08/10/2004 15:01:06

lu,
j'aime bien ce code :-)
l idée est sympa je trouve aussi
8 too

fabrice

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,045 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales