Dim w&
Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Frame1.Visible = True
Frame1.ZOrder 0
With ListBox1
If X > Cells(1).Width Then xx = Cells(1).Width: w = 2 Else xx = 0: w = 1
Frame1.Top = .Top + (10.3 * .ListIndex)
Frame1.Left = .Left + xx
Frame1.Height = 13
Frame1.Width = Cells(w).Width
TextBox1.Width = Cells(w).Width
TextBox1.Height = 13
TextBox1.Top = 0
TextBox1.Value = .List(.ListIndex, w - 1)
End With
End Sub
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then
With ListBox1
.List(.ListIndex, w - 1) = TextBox1.Value
End With
Frame1.Visible = False
End If
End Sub
Private Sub UserForm_Activate()
With ListBox1
.List = Cells(1, 1).Resize(5, 2).Value
.ColumnCount = 3
.ColumnWidths = Cells(1).Width & "pt;" & Cells(2).Width & "pt"
End With
End Sub
Dim w&
Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Frame1.Visible = True
Frame1.ZOrder 0
With ListBox1
If X > Cells(1).Width Then xx = Cells(1).Width: w = 2 Else xx = 0: w = 1
Frame1.Top = .Top + (Label1.Height * (.ListIndex))
Frame1.Left = .Left + xx
Frame1.Height = Label1.Height + 2
Frame1.Width = Cells(w).Width
TextBox1.Width = Cells(w).Width
TextBox1.Height = Label1.Height + 2
TextBox1.Top = 0
TextBox1.Value = .List(.ListIndex, w - 1)
End With
End Sub
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then
With ListBox1
.List(.ListIndex, w - 1) = TextBox1.Value
End With
Frame1.Visible = False
End If
End Sub
Private Sub UserForm_Activate()
With ListBox1
With Label1: .Font.Size = ListBox1.Font.Size: End With
.List = Cells(1, 1).Resize(5, 2).Value
.ColumnCount = 3
.ColumnWidths = Cells(1).Width & "pt;" & Cells(2).Width & "pt"
End With
End Sub
Je ne vois dans ce cas aucune nécessité de mettre à une telle fin la textbox au premier plan par rapport à la listbox.C'est uniquement pour apporter une précision sur un des items de la list box.
tout simplement.
Quoi ? Plait-il ?Sauf si tu as 15 list box ayant ce fonctionnement , donc 15 input box ??
Est une chose que je vais donc inscrire dans ma mémoire de sorte à ne pas risquer de te déplaire à nouveau.Merci de passer ton chemin