JJ 20.04.2016

This commit is contained in:
JenneJ
2016-04-20 17:14:49 +02:00
parent c9fc63e237
commit b13468f42c
6 changed files with 60 additions and 30 deletions

View File

@@ -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