first, thanks.
the problam is that in some computers, it works, and other its disapear.
same os (XP) and same IE(6)
here is my implementation code to OnDrawItem:
(u can copy this to the editor to see it clearly .....)
Protected Overrides Sub OnDrawItem(ByVal e As
System.Windows.Forms.DrawItemEventArgs)
MyBase.OnDrawItem(e)
If e.Index < 0 Then Return
Dim centerFormat As New StringFormat(StringFormatFlags.DirectionRightToLeft
Or StringFormatFlags.NoClip)
centerFormat.Alignment = StringAlignment.Near
centerFormat.LineAlignment = StringAlignment.Near
With e.Graphics
Dim textRectF As RectangleF = New RectangleF(New PointF(e.Bounds.X,
e.Bounds.Y), New SizeF(e.Bounds.Width - 34, e.Bounds.Height))
Dim imageRect As Rectangle = New Rectangle(e.Bounds.Right - 24, e.Bounds.Y +
4, 16, 16)
Dim butRect As Rectangle = New Rectangle(imageRect.X - 4, imageRect.Y - 4,
24, 24)
Select Case e.State
Case DrawItemState.Selected
'.DrawRectangle(Pens.Black, New Rectangle(e.Bounds.Left + (e.Bounds.Width -
16) / 2, e.Bounds.Y + 4, 16, 16))
If Not imlItems Is Nothing AndAlso CType(Me.Items(e.Index), HeaderData).Icon
< imlItems.Images.Count Then
..DrawImage(imlItems.Images(CType(Me.Items(e.Index), HeaderData).Icon),
imageRect)
End If
..FillRectangle(SystemBrushes.Highlight, textRectF)
..DrawString(Me.Items(e.Index).ToString, e.Font, SystemBrushes.HighlightText,
textRectF, centerFormat)
..DrawRectangle(Pens.Navy, butRect)
..DrawLine(Pens.White, butRect.Right, butRect.Y + 1, butRect.Right,
butRect.Bottom)
..DrawLine(Pens.White, butRect.X, butRect.Bottom, butRect.Right,
butRect.Bottom)
Case DrawItemState.Default, DrawItemState.None
'.DrawRectangle(Pens.Black, New Rectangle(e.Bounds.Left + (e.Bounds.Width -
16) / 2, e.Bounds.Y + 4, 16, 16))
If Not imlItems Is Nothing AndAlso CType(Me.Items(e.Index), HeaderData).Icon
< imlItems.Images.Count Then
..DrawImage(imlItems.Images(CType(Me.Items(e.Index), HeaderData).Icon),
imageRect)
End If
..FillRectangle(New SolidBrush(e.BackColor), textRectF)
..DrawString(Me.Items(e.Index).ToString, e.Font, New SolidBrush(e.ForeColor),
textRectF, centerFormat)
..DrawRectangle(New Pen(e.BackColor), butRect)
..DrawLine(New Pen(e.BackColor), butRect.Right, butRect.Y + 1, butRect.Right,
butRect.Bottom)
..DrawLine(New Pen(e.BackColor), butRect.X, butRect.Bottom, butRect.Right,
butRect.Bottom)
Case DrawItemState.HotLight
..DrawRectangle(Pens.White, butRect)
..DrawLine(Pens.Navy, butRect.Right, butRect.Y + 1, butRect.Right,
butRect.Bottom)
..DrawLine(Pens.Navy, butRect.X, butRect.Bottom, butRect.Right,
butRect.Bottom)
End Select
End With
End Sub