How can I Destroy a Control , created using Create() function...
Hi,
I'm creating a CStatic object dynamically ( Using Create() funtion ) and adding to a ListControl( Report Type) as a SubItem.
But the problem is when I deleted all items from the ListControl , the Cstatic control is remain there.
How can I destroy or remove That object from ListControl ?
Thanks
SK
[352 byte] By [
svcpp] at [2007-11-18 1:38:41]

# 1 Re: How can I Destroy a Control , created using Create() function...
Create CStatic object in heap (use new) and store pointer. When you need to destroy it, just call delete for this pointer.
Or you can hide the Static when you delete all items from ListCtrl
I hope, that u can understand me :)
deesan at 2007-11-10 8:54:03 >

# 2 Re: How can I Destroy a Control , created using Create() function...
Thanks
But I',m not creating using pointer object , If so cannt assign name to it .
Another thing is I put coding for adding Items to list control inside Timer Event . Everytime its refreshing the ListControl . So I cant hide the Static controls . The Program has to run may be for 1 hr or more and it'll create 'n' number of Objects.
svcpp at 2007-11-10 8:55:03 >

# 3 Re: How can I Destroy a Control , created using Create() function...
You usually destroy CWnd objects (which CStatic is derived from) with a call to DestoyWindow.
mje at 2007-11-10 8:56:01 >
