اود انشآء او التعديل على ال Listbox ؟
#6
هدا عبارة عن مكون ListBox عادى ... قم بلصق هده الكتابة على ال
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]
الرد


الردود في هذا الموضوع
اود انشآء او التعديل على ال Listbox ؟ - بواسطة hanipino - 01-01-2010, 08:05 AM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم