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?
example.JPG 154.04K
6 downloads


Sign In
Create Account

Back to top









