View Single Post
  #69 (permalink)  
Old 09-22-2007, 03:52 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Thumbs up Re: Visual C++ Tips & Tricks

Inserting a List View Item

Hi,

Here is the tips for adding an item to the listview control in VC++.
The InsertItem function is used to add an item to a list view control:

Inserting a List View Item
m_listItem.InsertItem( &listItem );
A pointer to an LV_ITEM structure is passed as the parameter to InsertItem. LV_ITEM data members are filled with data for the new item before it is inserted.

listItem.mask = LVIF_TEXT;
listItem.iItem = 0;
listItem.pszText = szText;
m_listCtrl.InsertItem( &listItem );
thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Reply With Quote