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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:57:25+00:00 2026-05-27T05:57:25+00:00

I have 2 forms: Form1 and Form2. I opened Form2 using: Form2 newForm2 =

  • 0

I have 2 forms: Form1 and Form2. I opened Form2 using:

Form2 newForm2 = new Form2(this);

And now I want to access some variables or methods from Form1 that are set in public like: public int counter;

But when I try this from Form2 it gives me an error:

Error 4 'System.Windows.Forms.Form' does not contain a definition for 'StartGame' and no extension method 'StartGame' accepting a first argument of type 'System.Windows.Forms.Form' could be found (are you missing a using directive or an assembly reference?)

Edit:
In form 1:

Form2 newForm2 = new Form2(answer, button3, button4, button5, button6, this, fiftyfifty, web, change);
newForm2.Show();

In form 2:

Form originalParent;
public Form2(int answer, Button button3, Button button4, Button button5, Button button6, Form parentform, int fiftyfifty, int web, int change)
{
    InitializeComponent();
    originalParent = parentform;
}

and I’m trying to access this like originalParent."public Method here" and it gives me that error.

  • 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-05-27T05:57:25+00:00Added an answer on May 27, 2026 at 5:57 am

    Your Form2 constructor is defined to get a generic Form as parameter in the constructor.
    You need to get a form of type Form1, so change your Form2 constructor to:

       private Form1 originalParent;
       public Form2(
              int answer, Button button3, Button button4,
              Button button5, Button button6,
              Form1 parentform, int fiftyfifty,
              int web, int change)
       { 
           InitializeComponent();
           originalParent = parentform;
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let say I have are two WPF forms: Form1 and Form2 . Form1 contains
I have a collection of MDI forms, where there are different objects (Form1,Form2 etc).
I have 3 forms in my project form1 , form2 , form3 and it
I have application in VB.net that have two different form (Form1 and Form2). Now
I have created some InfoPath forms. I am using MS-Office 2010. I deployed these
So I have an Access application, and I'd like some forms to be maximised
I have form which is opened using ShowDialog Method. In this form i have
I am using Access 2003 and I have a form that collects some filtering
if i have two media players in form1 and form2 respectively....how can i control
i have a prioblem with a callback because my Form1 open Form2 and send

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.