23-09-16, 01:26 AM
(22-09-16, 11:50 PM)HASAN6.0 كتب : قم بضبط الخاصيه OwnerDrow الى True , ثم اكتب الكود التاليشكرآ لاكن هذه السطر
PHP كود :
Private Sub ListView1_DrawItem(sender As Object, e As DrawListViewItemEventArgs) Handles ListView1.DrawItem
e.DrawBackground()
If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then
e.Graphics.FillRectangle(Brushes.LightGreen, e.Bounds)
End If
Using b As New SolidBrush(e.Item.ForeColor)
e.Graphics.DrawString(ListBox1.GetItemText(ListBox1.Items(e.Item.Index)), e.Item.Font, b, e.Bounds)
End Using
e.DrawFocusRectangle()
End Sub
e.Graphics.DrawString(ListBox1.GetItemText(ListBox1.Items(e.Item.Index)), e.Item.Font, b, e.Bounds)
لايمكن استخدامة مع listview

