IonicWind Software

IWBasic => General Questions => Topic started by: ckoehn on November 11, 2010, 04:58:52 PM

Title: ListBox changed
Post by: ckoehn on November 11, 2010, 04:58:52 PM
Is there a windows message that is sent when a listbox has had an item added to it?  In other words when the listbox count has changed.

Thanks,
Clint
Title: Re: ListBox changed
Post by: LarryMc on November 11, 2010, 05:12:35 PM
Not that I can find in the MS docs.

Since items can only be added by your code which you control, why would you need it to tell you?
Not being snide, just trying to understand.

You can SEND it a message to ask how many items are listed.

So if necessary you could have a global variabll to hold the count.
set up a timer to send the message to get the count periodically and see if it is different from the global variable.
if it is updATE THE GLOBAL COUNTER AND THEN DO WHAT EVER IT IS YOU ARE WANTING TO DO WHEN THE COUNT CHANGES.

LarryMc
Title: Re: ListBox changed
Post by: ckoehn on November 12, 2010, 06:32:55 AM
I am using another program to add to a listbox in the first program.  The first program needs to know when the listbox count has changed.

EDIT:  Thanks for jogging the brain cells Larry.  I just made the second program send a WM_USER+1 to the first to tell it it had made a change.

Thanks,
Clint