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 8501141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:07:37+00:00 2026-06-11T01:07:37+00:00

Im using Visual C# 2010 express. Im working on a game, and have come

  • 0

Im using Visual C# 2010 express. Im working on a game, and have come accross a small, newbie problem. Thing is, i guess we’re dealing with a best practise type situation, and none of the few beginner books i have really helped with it, so i hope you guys can.

So, i have two forms, one is a splashscreen/startup form and the other is the main game window. I made a class that contains all world data, and when in the first screen user clicks on “new game”, a new instance of this class is generated and populated with data.

So far so good.

The newgame button, in addition to creating the world instance, opens up the main game window. The problem is, in the main game window, when i try to use attributes of the gameworld instance, it says that it doesnt exist in this context.

So, if i get it right, the created instance only exists within the first form class… is that correct?

So if i’d like to move that whole data, should i actually serialize and save the world class instance data, and load it in the second form? Or how should i approach this.

I understand it’s a very newbie question, and i could propably hack it to work, but the thing is – i really feel like i have to understand everything im doing.

Thanks in advance!

  • 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-11T01:07:38+00:00Added an answer on June 11, 2026 at 1:07 am

    If there is a reference of the world data object in the splash screen, you can assign this to a public member in the main screen, or pass it to the main screen through a constructor.

    so in the splash screen

    FrmMain frmMain = new FrmMain();
    frmMain.WorldData = this.WorldData;
    

    if it is an instance member of the splash screen

    or maybe something like

    FrmMain frmMain = new FrmMain();
    frmMain.WorldData = new WorldData();
    

    or even

    FrmMain frmMain = new FrmMain(this.WorldData);
    

    or

    FrmMain frmMain = new FrmMain(new WorldData());
    

    with the FrmMain constructor as

    public FrmMain(WorldData worldData)
    {
        this.m_WorldData = worldData;
    }
    

    Have a look at Passing Data Between Forms

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

Sidebar

Related Questions

I am using Visual C# Studio 2010 Express and I have oakward problem. I
I am using Microsoft Visual Basic 2010 Express. I have a WPF-based project. I
I'm working on a personal project in Visual Studio 2010 Express edition, using ASP.NET
I'm working on a WPF application with Visual Studio 2010 Express. I have a
I have a project I'm working on in Visual Studio 2010 Express in C++/CLI
I've been working on a simple windows program using Visual C++ 2010 express on
My Problem In Microsoft Visual Web Developer Express 2010, my intellisense suddenly stopped working
I already have Visual Studio 2010 SP1 installed. I am using express edition. Also,
I am working in Visual Web Developer 2010 Express, and using the Entity Framework
Using Visual Studio 2010 Express I have a task list open and on filter

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.