Création d'un ScrollBar

Résolu
johspi Messages postés 19 Date d'inscription mardi 15 juin 2004 Statut Membre Dernière intervention 7 septembre 2010 - 20 juil. 2010 à 13:25
johspi Messages postés 19 Date d'inscription mardi 15 juin 2004 Statut Membre Dernière intervention 7 septembre 2010 - 20 juil. 2010 à 16:41
Bonjour tout le monde,

Je suis entrain de developpez un logiciel qui fonctionnera sur des écrans tactil et mon souci viens des scrollbars rattachés a mon composant TListView qui sont trop petit et pas pratique a utiliser (surtout si on a des gros doigt).

Ma solution est de faire 2 boutons permettant de me deplacer vers le bas ou le haut.

Je suis donc à la recherche d'un exemple qui montre le code de fonctionnement d'un ScrollBar ou qui pourrait me guider.


Merci d'avance

3 réponses

Cirec Messages postés 3833 Date d'inscription vendredi 23 juillet 2004 Statut Modérateur Dernière intervention 18 septembre 2022 50
20 juil. 2010 à 15:55
Salut,

essaye plutôt comme ça:

ListBox1.Perform(WM_VScroll, SB_LINEUP, 0);

ListBox1.Perform(WM_VScroll, SB_LINEDOWN, 0);

les autres commandes sont:
  { Scroll Bar Commands }
  {$EXTERNALSYM SB_LINEUP}
  SB_LINEUP = 0;
  {$EXTERNALSYM SB_LINELEFT}
  SB_LINELEFT = 0;
  {$EXTERNALSYM SB_LINEDOWN}
  SB_LINEDOWN = 1;
  {$EXTERNALSYM SB_LINERIGHT}
  SB_LINERIGHT = 1;
  {$EXTERNALSYM SB_PAGEUP}
  SB_PAGEUP = 2;
  {$EXTERNALSYM SB_PAGELEFT}
  SB_PAGELEFT = 2;
  {$EXTERNALSYM SB_PAGEDOWN}
  SB_PAGEDOWN = 3;
  {$EXTERNALSYM SB_PAGERIGHT}
  SB_PAGERIGHT = 3;
  {$EXTERNALSYM SB_THUMBPOSITION}
  SB_THUMBPOSITION = 4;
  {$EXTERNALSYM SB_THUMBTRACK}
  SB_THUMBTRACK = 5;
  {$EXTERNALSYM SB_TOP}
  SB_TOP = 6;
  {$EXTERNALSYM SB_LEFT}
  SB_LEFT = 6;
  {$EXTERNALSYM SB_BOTTOM}
  SB_BOTTOM = 7;
  {$EXTERNALSYM SB_RIGHT}
  SB_RIGHT = 7;
  {$EXTERNALSYM SB_ENDSCROLL}
  SB_ENDSCROLL = 8;


[hr]@+Cirec
[hr]
3
johspi Messages postés 19 Date d'inscription mardi 15 juin 2004 Statut Membre Dernière intervention 7 septembre 2010
20 juil. 2010 à 14:25
J'ai trouver une bidouille pour le faire

procedure TMain.SpeedButton1Click(Sender: TObject);
begin
LVInfo.SetFocus;
keybd_event(VK_PRIOR ,0,1,0); //Bouton Pg.Préc
end;

procedure TMain.SpeedButton2Click(Sender: TObject);
begin
LVInfo.SetFocus;
keybd_event(VK_NEXT ,0,1,0); //Bouton Pg.Suiv
end;

Si quelqu'un connait une autre solution, je suis preneur car d'utiliser la simulation de touche ne me ravi pas plus que sa
0
johspi Messages postés 19 Date d'inscription mardi 15 juin 2004 Statut Membre Dernière intervention 7 septembre 2010
20 juil. 2010 à 16:41
Sa marche niquel !!!!!!

Merci beaucoup sa sera beaucoup mieu que ma bidouille

cirec
0
Rejoignez-nous