我创建了自己的组合框,并进行了一些小的更改。但是我在下拉列表中遇到错误。
我将combobox.DroppedDown = True
设置为
每当我打开新表单时,每种表单都会发生这种情况。
组合框代码为
Public Class MainComboxex
Inherits ComboBox
Private Sub MainComboBoxEx_Enter(sender As Object, e As EventArgs) Handles Me.Enter
Me.BackColor = Color.FromArgb(247, 180, 65)
End Sub
Private Sub MainComboBoxEx_Leave(sender As Object, e As EventArgs) Handles Me.Leave
Me.BackColor = Color.White
End Sub
'Private Sub InitializeComponent()
' Me.SuspendLayout()
' Me.ResumeLayout(False)
'End Sub
Private Sub MainComboxex_KeyPress(sender As Object, e As KeyPressEventArgs) Handles Me.KeyPress
Try
If Char.IsControl(e.KeyChar) = False Then
e.Handled = AutoFillCombo(Me, e.KeyChar.ToString)
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class