List Box item Count change problem 
Author Message
 List Box item Count change problem

hi,

How is it possible to invoke a functoin when the listbox item count changes
change the item ie Add an item or delete an item from the list box.

Thanks
Jerin Jacob



Sun, 22 May 2005 19:10:50 GMT  
 List Box item Count change problem
It isn't built in. One approach is to subclass the list control and do

int CMyListBox::AddString(LPCTSTR s)
    {
     int n = CListBox::AddString(s);
     GetParent()->SendMessage(UWM_IVE_ADDED_SOMETHING, (WPARAM)m_hWnd,
MAKELONG(GetDlgCtrlID(), n));
     return n;
    }

using a user-defined message. You will need to do the same thing for InsertString.
                                joe

Quote:

>hi,

>How is it possible to invoke a functoin when the listbox item count changes
>change the item ie Add an item or delete an item from the list box.

>Thanks
>Jerin Jacob


Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Sun, 22 May 2005 07:19:34 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. i cannot add an item to my list box that is located within my dialog box

2. Disabling editing of list box items in the file open dialog box

3. How to limit item count in list control

4. Problem with changing color in a List Box..

5. List Box - Add item does option does not exist as in VB.

6. Preventing list box selection AFTER clicking on item.

7. List Items in Combo Box

8. Selecting Items from a multi select list box VC++ 6.0 on W2K

9. List Items in Combo Box

10. List boxes and Large amounts of items

11. List Items in Combo Box

12. List Items in Combo Box

 

 
Powered by phpBB® Forum Software