01-01-2010, 08:05 AM
هدا عبارة عن مكون ListBox عادى ... قم بلصق هده الكتابة على ال
Form
جرب هدا فى حدث DrawItem
Form
PHP كود :
object ListBox1: TListBox
Left = 16
Top = 24
Width = 249
Height = 100
Style = lbOwnerDrawVariable
BorderStyle = bsNone
Color = 11775662
ItemHeight = 20
Items.Strings = (
'Item 0'
'Item 1'
'Item 2'
'Item 3'
'Item 4')
TabOrder = 0
end
جرب هدا فى حدث DrawItem
PHP كود :
begin
with ListBox1.Canvas do
begin
Pen.Color := RGB(127, 157, 185);
if Index < 1 then
Rectangle(Rect)
else
Rectangle(Rect.Left, Rect.Top - 1, Rect.Right, Rect.Bottom);
if (odSelected in State) then
begin
Brush.color := ListBox1.Color;
Font.color := 255;
Fillrect(Rect);
end;
TextOut(Rect.Left + 3, Rect.Top + 2, ListBox1.Items[Index]);
end;
end;
النتيجة
![[صورة: 725142558.png]](http://www13.0zz0.com/2010/01/01/06/725142558.png)
![[صورة: 725142558.png]](http://www13.0zz0.com/2010/01/01/06/725142558.png)

