Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

How Do I Programmatically Scroll a Listbox Control in LabWindows/CVI

Primary Software: LabWindows/CVI Development Systems>>Base Package
Primary Software Version: 7.0
Primary Software Fixed Version: N/A
Secondary Software: LabWindows/CVI Development Systems>>Full Development System

Problem:
How do I make my Listbox control scroll to show the most recently added data automatically?

Solution:
You can insert items to the end of the Listbox control by passing a -1 to the item index parameter.  Then, find the current number of elements in the Listbox.  Lastly, set the active row to the last item.  This procedure is demonstrated in the following code.

InsertListItem (panelHandle, PANEL_LISTBOX, -1, "Item in Listbox Name", 0);
GetNumListItems (panelHandle, PANEL_LISTBOX, &size);
SetCtrlAttribute (panelHandle, PANEL_LISTBOX, ATTR_CTRL_INDEX, size-1);


Related Links:

Attachments:





Report Date: 01/22/2008
Last Updated: 01/22/2008
Document ID: 4HL891QX

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit