Forumunuz.Com

Forumunuz.Com (https://www.forumunuz.com/)
-   Webmaster Forum (https://www.forumunuz.com/webmaster-forum/)
-   -   listbox nesnesinde seçili öğenin rengini değiştirmek (https://www.forumunuz.com/webmaster-forum/17416-listbox-nesnesinde-secili-ogenin-rengini-degistirmek.html)

Kaf Dağı 27 Mart 2015 15:33

listbox nesnesinde seçili öğenin rengini değiştirmek
 
Kod:

//Listbox'ın style özelliği lbOwnerDrawFixed olmalı
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer; Rect:
TRect; State: TOwnerDrawState);
begin
if odFocused in State then
begin
ListBox1.Canvas.Brush.Color := clRed;
ListBox1.Canvas.Font.Color := clYellow;
ListBox1.Canvas.Font.Style := [fsBold];
end;
ListBox1.Canvas.FillRect(Rect);
ListBox1.Canvas.TextOut(Rect.Left,Rect.Top,ListBox1.Items[Index]);
end;
-------------------------------------------------------------------------------
//listbox'taki en son öğeye scroll yapma   
SendMessage(ListBox1.Handle,lb_SetTopIndex,2,0);



Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 00:08.

Powered by vBulletin® Version 3.8.9   Copyright ©2000 - 2026, vBulletin Solutions, Inc.

Site kurucuları: Damla ve Meltem