Home > Software engineering >  VBA to obtain the mouse in the COMBOBOX items at present
VBA to obtain the mouse in the COMBOBOX items at present

Time:11-15

Ask: how to get the mouse in the COMBOBOX in VBA current items, not have the text of the text, the mouse is moved up and down the current table of a particular item, thank you

CodePudding user response:

In the absence of a scroll bar, can I try this code below,
Form on a button, a comboBox a lable

 
Private Sub ComboBox1_MouseMove (ByVal Button As an Integer, ByVal Shift As an Integer, ByVal X As Single, ByVal Y As Single)
On the Error Resume Next
Me. Label1. Caption=Me.Com boBox1. List (Int (Y/Me.Com boBox1. The Font. The Size))
End Sub

Private Sub CommandButton1_Click ()
Dim As Integer I
For I=1 To 10
Me.Com boBox1. AddItem "item" & amp; I
Next
End Sub



  •  Tags:  
  • VBA
  • Related