Scroll tglistbox to a given element

Hello,

Simple question, but I don’t find the answer :
How to scroll a TGListBox to see a given element (specified by id for example) ?
I tried :
fCombo->GetVScrollbar()->SetPosition(selectedId);
But it didn’t work.

Thank you,
Barth

Hi Barth,

AFAIK, there is no obvious solution for this… I’ll check if it is possible at all and let you know.

Cheers, Bertrand.

Hi Bertrand,

Ok thank you.

Barth

Well, I was too fast… Here is a possible solution (depending on what is selectedId):

((TGLBContainer *)fCombo->GetContainer())->SetVsbPosition(selectedId);If it doesn’t work, please post a simple running macro reproducing the problem.

Cheers, Bertrand.

It works like a charm !
Thank you very much.
Barth