Vertragsverwaltung-Klassenbibliothek  

ComboIcon.OnDrawItem -Methode

[Visual Basic]
Protected Overrides Sub OnDrawItem( _ 
ByVal e As DrawItemEventArgs
)

Parameter

e

Quellcode

[Visual Basic]
    Protected Overrides Sub OnDrawItem(ByVal e As System.Windows.Forms.DrawItemEventArgs) 
e.DrawBackground() 
e.DrawFocusRectangle() 
 
Dim item As New ComboBoxIconItem 
Dim imageSize As New Size 
imageSize = ListaImg1.ImageSize 
 
Dim bounds As New Rectangle 
bounds = e.Bounds 
 
Try 
item = Me.Items(e.Index) 
If (item.ImageIndex <> -1) Then 
Me.ImageList.Draw(e.Graphics, bounds.Left, bounds.Top, item.ImageIndex) 
e.Graphics.DrawString(item.Text, e.Font, New SolidBrush(e.ForeColor), bounds.Left + imageSize.Width, bounds.Top) 
Else 
e.Graphics.DrawString(item.Text, e.Font, New SolidBrush(e.ForeColor), bounds.Left, bounds.Top) 
End If 
Catch ex As Exception 
If (e.Index <> -1) Then 
e.Graphics.DrawString(Items(e.Index).ToString(), e.Font, New SolidBrush(e.ForeColor), bounds.Left, bounds.Top) 
Else 
e.Graphics.DrawString(Text, e.Font, New SolidBrush(e.ForeColor), bounds.Left, bounds.Top) 
End If 
 
End Try 
MyBase.OnDrawItem(e) 
End Sub

Forderungen

Plattformen: Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

Siehe auch

ComboIcon