Вниз
Скачать: CL | DM;

Сохранить все позиции ListBox a, а затем их вернуть как?   Найти похожие ветки 

← →
sormy   (2005-05-24 23:39) [0]

Допустим, проскроллен ЛистБокс на какую-то позицию.
Как ее вычислить, сохранить и затем обратно вернуть?...
Фишка с ItemSelected прокатывает, но не так как хотелось бы - т.е. чтоб один в один позиция совпадала в конечном счете ...


← →
Thaddy   (2005-05-25 00:41) [1]

Listbox.perform(LB_SETITEMDATA,ItemIndex,TheIdentifier);
Value:=ListBox.Perfprm(LB_GETITEMDATA,ItemIndex,0);

Will that help?


← →
sormy   (2005-05-25 08:19) [2]

What is Value, ItemIndex and TheIdentifier in first and second string?


← →
Thaddy   (2005-05-25 12:41) [3]

The item index is the index of the string in the listbox
The identifier is the value that you yourself associate with that string.
The value of the function is the returned identifier of the string based on the current index of the string in the listbox.
So if you delete a string the identifiers of the other strings will always be the same, although the index of the strings may change.
That covers exactly what you want, doesn"t it?


← →
Sormy   (2005-05-25 20:33) [4]

Thanks!

I had done this in such way:

   lbSelectedItem:=ListBox1.CurIndex;
   lbTopIndex:=ListBox1.Perform(LB_GETTOPINDEX, 0, 0);

//operations with list edit

   ListBox1.Perform(LB_SETTOPINDEX, lbTopIndex, 0);
   ListBox1.curindex:=lbSelectedItem;



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

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.023 c
2-1135624073
erudit
2005-12-26 22:07
2006.01.22
Перевернуть компонент Image1


1-1134988402
КодеКорешь
2005-12-19 13:33
2006.01.22
Как узнать сколько эзепляров данной формы уже создано


11-1117925548
rofl
2005-06-05 02:52
2006.01.22
Kol Memo (Editbox) limited to 30000 bytes of text


9-1123252920
Андрей235
2005-08-05 18:42
2006.01.22
Карточная игра "дурак


14-1135576401
vidiv
2005-12-26 08:53
2006.01.22
Иконка в трей




   Наверх