LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

scroll bar control of a listbox

Hallo again,

I've got the following problem now:
I fill my list box item after item. When the lines are full, the scrollbar appear.
The scrollbar keeps always the first item in front. (however the items entry; at the head or at the end of the listbox)

I would like that the last entry is always shown and not the first.

With which function can I realise that?

something like the opposite of "GetCurrentlySelectedFile()"

thx
Florian

Message Edited by Greber on 04-20-2005 10:15 AM

0 Kudos
Message 1 of 3
(2,633 Views)
There's nothing I know of to automatically keep the list pointing to the last item. You can set it to the bottom each time you add an item.
Use GetNumListItems to determine how many items are in your list.
Use SetCtrlIndex to set the index to numItems-1 (index is 0 based).
0 Kudos
Message 2 of 3
(2,626 Views)
Hello Greber,

I think what you are looking to do is to set the last visible line of the listbox to the last entry in the listbox. I would suggest doing something like this:

int index = 0;
GetNumListItems (panelHandle, PANEL_LISTBOX, &index);
SetCtrlAttribute (panelHandle, PANEL_LISTBOX, ATTR_FIRST_VISIBLE_LINE, index);


Hope that helps.
0 Kudos
Message 3 of 3
(2,619 Views)