Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8162207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:39:28+00:00 2026-06-06T18:39:28+00:00

In my program, All of my classes are using singleton pattern, except the one

  • 0

In my program, All of my classes are using singleton pattern, except the one which is the main window. Because of that, all the singleton connections are maintained by one singleton class, “Manager”. GUI access methods in other classes via the public methods in this class.

Now, I am trying to save my work (serialize) and I am always getting the error “Form1 not serialized”. That is the GUI class. So, I marked that as serialized, knowing that is not a good idea. Now it is saying “System.windows.forms not serialized”. Why is this? Is it unable to serialize a class with singleton access? Please help.

Note: I am a Java developer learning “Head First C#”. This is my first attempt to make one of their “Lab” problems in my own preferred way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T18:39:29+00:00Added an answer on June 6, 2026 at 6:39 pm

    Without seeing code it’s hard to know what is wrong. Principally one can serialize a form (I just did so using the sample Test<T>(T obj) method from MSDN which uses DataContractSerializer).

    Having said that… it is unwise to serialize the form itself in order to save the form state. Instead, you should keep your data in a separate class (commonly referred to as a Model class, see MVC) and serialize the data instead. Use data binding or the MVC pattern to connect your form (the view) to the data (the model).

    If this is WinForms (as I presume), one can use MVC with WinForms

    https://stackoverflow.com/questions/2406/looking-for-a-mvc-sample-for-winforms

    For information about data binding with WinForms, see

    http://msdn.microsoft.com/en-us/library/ef2xyb33.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Last week, we created a program that manages sets of strings, using classes and
I'm writing a program that counts all binary trees with n nodes and height
I need to write a simple program that records all the input from parallel
I am using Netbeans. How to know all the classes of a package(say lucene,
Lets say we have a program which contains such classes: public interface AbstractItem {
I want to have a Singleton that will be auto instantiated on program start.
I have written a program which scans css files using jar cssparser-0.9.5.jar and i
I have made a simple, test program to experiment using classes. It creates a
I have a number of classes doing different things but using the same Singleton
I am creating a GUI program using MVC which should look like this.. alt

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.