|
-
May 26th, 2004, 01:26 PM
#1
usercontrols... collection value isnt saved when changed at design time
hmm I dont know how to explain it because I dont really know what I'm doing 
I have a class which inherits from CollectionBase. And I have a public property in my usercontrol of that type, so:
VB Code:
Public myClass:Inherits CollectionBase
End Class
...
'In user control:
<Browsable (true)> _
Public Property myClass SomeCollection
'Get, Set....
End Property
now when I add the usercontrol to my form, and I look at the SomeCollection property, I can click on a little "..." button and the VS Collection Editor shows up... I can add items, but the thing is that the items all disappear after I run the project (so when you check the SomeCollection property, there is no items in the collection anymore, all get cleared)....
I think I'm doing something fishy here, but I cant figure out what... anyone else ever had this problem?
let me know if I'm not explaining enough
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
May 26th, 2004, 03:47 PM
#2
Hi.
You need to set the DesignerSerializationVisible attribute to Content.
Also, you might need to create a typeconverter depending of the object in the collection.
I suggest taking a look at http://www.divil.co.uk/net/articles/...oncontrols.asp. He has a very good explanation and demo of how to use custom collections in usercontrols.
Hope it helps.
Good luck.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|