請教:如何在VBA中獲取COMBOBOX中滑鼠當前項內容,不是已經選擇的text文本,是滑鼠上下移動時下拉表的某一項內容。謝謝
uj5u.com熱心網友回復:
在沒有滾動條的情況下,可以試試我下面這段代碼。表單上放一個按鈕,一個comboBox 一個lable
Private Sub ComboBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
On Error Resume Next
Me.Label1.Caption = Me.ComboBox1.List(Int(Y / Me.ComboBox1.Font.Size))
End Sub
Private Sub CommandButton1_Click()
Dim i As Integer
For i = 1 To 10
Me.ComboBox1.AddItem "item" & i
Next
End Sub
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/23387.html
標籤:VBA
上一篇:分享一個Pr Ps Ae C4d Lr插件一鍵安裝的,本人原創的 2019年9月28日發布的,有著作權的哈 ,大家可以免費來領取一份哈
