Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.07.10;
Скачать: CL | DM;

Вниз

Горизонтальная прокрутка ListBox   Найти похожие ветки 

 
ocean ©   (2003-06-26 12:42) [0]

Согласно рекомендации в FAQ, добавляю в FormCreate:

ListBox1.Perform(LB_SETHORIZONTALEXTENT, 250, Longint(0));

Но горизонтальная прокрутка не появляется! Что не так?


 
KILLER_ABV ©   (2003-06-26 13:00) [1]

Попробуй этот код:

procedure TForm1.FormCreate(Sender: TObject);
var
i, MaxWidth: integer;
begin
MaxWidth := 0;
for i := 0 to LB1.Items.Count - 1 do
if MaxWidth < LB1.Canvas.TextWidth(LB1.Items.Strings[i]) then
MaxWidth := LB1.Canvas.TextWidth(LB1.Items.Strings[i]);
SendMessage(LB1.Handle, LB_SETHORIZONTALEXTENT, MaxWidth+2, 0);
end;


 
ocean ©   (2003-06-26 13:18) [2]

Все выяснилось. Надо было завести хоть одну строчку во время design.

Спасибо!


 
KILLER_ABV ©   (2003-06-26 13:23) [3]

Незашто!!!


 
Song ©   (2003-06-26 13:54) [4]

LB_SETHORIZONTALEXTENT
wParam = (WPARAM) cxExtent; // horizontal scroll width
lParam = 0; // not used; must be zero


Parameters

cxExtent

Value of wParam. Specifies the number of pixels by which the list box can be scrolled.
Windows 95: The wParam parameter is limited to 16-bit values.



Return Values

This message does not return a value.

Remarks

To respond to the LB_SETHORIZONTALEXTENT message, the list box must have been defined with the WS_HSCROLL style.



Страницы: 1 вся ветка

Текущий архив: 2003.07.10;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.025 c
6-31374
EvgenTss
2003-05-04 14:14
2003.07.10
Создаю ip пакет вручную, проблема с setsockopt


1-31343
INTAARI
2003-06-27 13:24
2003.07.10
Не поймать исключение


14-31447
anbezr
2003-06-23 18:43
2003.07.10
Определить, уничтожен ли объект


1-31290
Oleg
2003-06-26 15:00
2003.07.10
Подскажите пожалуйста как


1-31350
-=GaLaN=-
2003-06-27 15:34
2003.07.10
Как узнать длину строки в пикселях?