Jump to content

Trouble accessing / showing a form between projects

- - - - -

  • Please log in to reply
No replies to this topic

#1
nunnbt473

nunnbt473

    Newbie

  • Members
  • Pip
  • 5 posts
Error 3 'FormOne.Form1' does not contain a definition for 'Show' and no extension method 'Show' accepting a first argument of type 'FormOne.Form1' could be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Administrator\My Documents\Game\XnaGraphics\XnaGraphics\Program.cs 18 15 XnaGraphics

Calling program, Game1.cs
using System;

using WindowsGame1;


//Namespace containing the code inside of Form1.cs

using FormOne;


namespace XnaGraphics

{

#if WINDOWS || XBOX

    static class Program

    {

        /// <summary>

        /// The main entry point for the application.

        /// </summary>

        static void Main(string[] args)

        {

            Form1 f = new Form1();

            f.Show(); //.Show isn't recognized here. 

           

            using (Game1 game = new Game1())

            {game.Run();  }

        }

    }

#endif

}

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;


namespace FormOne

{

    public partial class Form1 : Form

    {

        public Form1()

        {InitializeComponent();}


    }

}

It seems like no matter what form I reference outside of the project, I cannot properly create a new instance of it. And when the compiler says I have created a new instance of it, it fails to acknowledge basic form methods like .Show(); I did add containing the form as a reference via the Project tab to the calling project's references. I've even tried Form1 test; in the referenced file/form and test = new Form1(); in the calling project to no avail.

Any suggestions as to what might prevent me from creating a new copy of a form?

Attached File  example.JPG   154.04K   6 downloads




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users