JJ 20.04.2016
This commit is contained in:
@@ -7,23 +7,36 @@
|
||||
DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnEnabledChanged(e As EventArgs)
|
||||
'MyBase.OnEnabledChanged(e)
|
||||
'Protected Overrides Sub OnEnabledChanged(e As EventArgs)
|
||||
' 'MyBase.OnEnabledChanged(e)
|
||||
|
||||
If Me.Enabled Then
|
||||
Me.DropDownStyle = ComboBoxStyle.DropDown
|
||||
Else
|
||||
Me.DropDownStyle = ComboBoxStyle.DropDownList
|
||||
End If
|
||||
End Sub
|
||||
' If Me.Enabled Then
|
||||
' Me.DropDownStyle = ComboBoxStyle.DropDown
|
||||
' Else
|
||||
' Me.DropDownStyle = ComboBoxStyle.DropDownList
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
Protected Overrides Sub OnDrawItem(e As DrawItemEventArgs)
|
||||
Dim g As System.Drawing.Graphics = e.Graphics
|
||||
Dim rect As Rectangle = e.Bounds
|
||||
|
||||
If e.Index >= 0 Then
|
||||
Dim label As String = Me.Items(e.Index).ToString()
|
||||
Dim label As String
|
||||
|
||||
If (Me.Items(e.Index).GetType() = GetType(String)) Then
|
||||
label = Me.Items(e.Index).ToString()
|
||||
Else
|
||||
Dim rowView As DataRowView = Me.Items(e.Index)
|
||||
Dim rowCount As Integer = rowView.Row.ItemArray.Count
|
||||
|
||||
|
||||
If rowCount = 1 Then
|
||||
label = rowView.Item(0)
|
||||
ElseIf rowCount = 2 Then
|
||||
label = rowView.Item(1)
|
||||
End If
|
||||
End If
|
||||
|
||||
If e.State = (DrawItemState.Disabled Or DrawItemState.NoAccelerator Or DrawItemState.NoFocusRect Or DrawItemState.ComboBoxEdit) Then
|
||||
' DISABLED STATE
|
||||
|
||||
Reference in New Issue
Block a user