1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Option Explicit
Private Declare Function SendMessageByNum Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, ByVal _
wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Const LB_SETHORIZONTALEXTENT = &H194
Function barre_defilement_list(longueur_chaine As Variant)
Static X As Long
If X < longueur_chaine / Screen.TwipsPerPixelX Then
X = longueur_chaine
If Form_connexion.ScaleMode = vbTwips Then
X = X / Screen.TwipsPerPixelX ' if twips change to pixels
SendMessageByNum Form_connexion.List1.hwnd, LB_SETHORIZONTALEXTENT, X, 0
SendMessageByNum Form_connexion.List2.hwnd, LB_SETHORIZONTALEXTENT, X, 0
End If
End If
End Function |
Partager