I have been programming in Java for a few years and am now trying to teach myself C#. I am using Visual Studio 2010 as my IDE.
I have created a basic form called AddVideo, and I have a separate file called Program.cs
I want Program.cs to display an instance of the AddVideo form.
So far I have tried to do:
Code:
AddVideo form = new AddVideo();
But when I run Program.cs, it displays the program for less than a second and then exits.
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new AddVideo());
}
}
An IDE could help you avoid this sort of syntactical forgetfulness. I strongly recommend SharpDevelop since it is free, open-source.
Best Regards,
BioPhysEngr http://blog.biophysengr.net
--
All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new AddVideo());
}
}
Oh, well then use it to generate a WinForms project. :-)
Best Regards,
BioPhysEngr http://blog.biophysengr.net
--
All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
Bookmarks