
20.03.2012, 22:29
|
 |
.
|
|
Регистрация: 18.05.2011
Адрес: Омск
Сообщения: 3,970
Версия Delphi: 3,5,7,10,12,XE2
Репутация: выкл
|
|
Для изменения высоты выделенного Item-а, этого достаточно:
Код:
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
var
Selected : Boolean;
begin
Selected := (State = [odSelected, odFocused]) or (State = [odSelected]);
if Selected then
SendMessage(ListBox1.Handle, LB_SETITEMHEIGHT, Index, 45)
else
SendMessage(ListBox1.Handle, LB_SETITEMHEIGHT, Index, 16);
with ListBox1.Canvas do
begin
FillRect(Rect);
if Selected then
begin
Font.Style := [fsBold];
Font.Size := 24;
end
else
begin
Font.Style := [];
Font.Size := 8;
end;
TextOut(Rect.Left + 1, Rect.Top + 1, ListBox1.Items[Index]);
end;
end;
__________________
Je venus de nulle part
55.026263 с.ш., 73.397636 в.д.
|