Mega Code Archive

 
Categories / Delphi / VCL
 

Listboxta seçili öğenin rengini değiştirme ve listboxtaki en son öğeye scroll yapma

//drony@mynet.com //icq:266148308 //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);