Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

[serializable]

public class ImageLB : ListBox

{}

 

That is my custom ListBox class. When I create a new instance of it and try to save it using the BinaryWriter it says ListBox is not serializable.

 

I want to save my entire ListBox (ImageLB) to disk with all it's items and properties. Is this possible?

C#
  • *Experts*
Posted
You will need to extract the data from the Items collection and put it in your own serializable collection, then serialize that. No part of the ListBox is serializable as-is.
Posted
You're saying I need to take it apart and put it back together? A small explanation of how to strip it and put it back together would be helpful. Just so I have some direction. If you would, VolteFace.
C#
Posted

What was I thinking! All I have to do is save the Items property to disk! That is all I need! Thanks VolteFace.

 

Although that does not work unless I first put the items into my own Array and save them. No problem though.

C#

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...