Create forms in runtime - C#

In Java You could create JFrames pretty easily and with Containers and JPanels you could have complete control over the game window by developing the components code side. What is the syntax for these functions in C#? Clearly I won't be instantiating JFrames. Is it a Windows Form? What components go into a windows form (Panels, boarders,etc)? 

Form form = new Form();

form.show();

For customizing the form, try: form. functions to change aspects of it like dimensions, etc.  That will give you all the options you need.  Obviously, you'll need to import System.Windows.Forms 

 Honestly though, you're probably better off making the form first and simply hiding it until you need it, because trying to code the dimensions of labels and menus and stuff can be a nightmare.  Visual Studio makes it so much easier with drag and drop.  

Great thanks. I'm moving towards rough game dev. So I need more control and less labels so that's perfect.

class FormTest
{
static void Main(String[] args)
{
Form form = new Form();
form.show();
}
}

VS is throwing an error. It does not seem to recognize Form. 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

This is all added by VS. Not sure if I need something else like in Java where you need to import javax.swing.*. 

Maybe it has something to do with being in the main rather than in a seperate class?

sorry, that code got mangled.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace FormTest

{

class FormTest

{

static void Main(String[] args)

{

Form form = new Form();

form.show();

}

}

 

I know its long forgotten post, but still:

COGlory is right. Code he suggested works, but you r missing

  • using System.Windows.Forms;