Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

ListBox de taille variable

2 réponses
Avatar
M41
Bonjour

Comment multiplier par 3 la hauteur d'une
ListBox contenue dans un UserForm
quand elle a le focus ?
... et diviser par 3 quand elle le perd ?

MoveMouse permet l'un ou l'autre
mais pas les 2

Cordialement

M41

2 réponses

Avatar
JB
Bonsoir,

Private Sub ListBox1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
If X < 10 Or X > ListBox1.Width - 10 Or Y < 10 Or Y >
ListBox1.Height - 10 Then
Me.ListBox1.Height = 30
Else
Me.ListBox1.Height = 90
End If
End Sub

http://cjoint.com/?jsvcdirkTT

JB
http://boisgontierjacques.free.fr


On 18 sep, 20:01, "M41" wrote:
Bonjour

Comment multiplier par 3 la hauteur d'une
ListBox contenue dans un UserForm
quand elle a le focus ?
... et diviser par 3 quand elle le perd ?

MoveMouse permet l'un ou l'autre
mais pas les 2

Cordialement

M41


Avatar
M41
Bonjour(re)

Depuis mon message j'avais trouvé la solution jumelle :

Private Sub ListBox55_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim i As Long: i = 25
With ListBox55
If (X < 5 Or X > (.Width - 5)) Or (Y < 5 Or Y > (.Height - 5)) Then
.Height = i
Else
.Height = i*3
End If
End With
End Sub

Merci. Cordialement

M41




"JB" a écrit dans le message de news:

Bonsoir,

Private Sub ListBox1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
If X < 10 Or X > ListBox1.Width - 10 Or Y < 10 Or Y >
ListBox1.Height - 10 Then
Me.ListBox1.Height = 30
Else
Me.ListBox1.Height = 90
End If
End Sub

http://cjoint.com/?jsvcdirkTT

JB
http://boisgontierjacques.free.fr


On 18 sep, 20:01, "M41" wrote:
Bonjour

Comment multiplier par 3 la hauteur d'une
ListBox contenue dans un UserForm
quand elle a le focus ?
... et diviser par 3 quand elle le perd ?

MoveMouse permet l'un ou l'autre
mais pas les 2

Cordialement

M41