Join 136,162 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,909 people online right now. Registration is fast and FREE... Join Now!
I have a [problem I've never experienced before. I started working on a C# web browser for a tutorial, I have tons tons of work done so far, and when I hi the play button to view my work and see how the functionality works so far, but the form doesn't show. What I get is some blank form with zero controls on it, I obviously didn't create it as all my forms have controls. SO I went into Program.cs to make sure the correct form was being starter
CODE
using System; using System.Collections.Generic; using System.Windows.Forms;
namespace PC { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmBrowser()); } } }
As you can see, the last line Application.Run(new frmBrowser()); is indeed calling the correct form, so what the hell I supposed to do here?!?! I am now begging for help here folks, as most of you know this is not homework, please help me
Hmmm..interesting, I don't believe I have ever heard of a situation like this.
Is it possible to test your project on a different computer? This way you can eliminate it as being a system specific issue as the cause of the problem.
Are these designer created controls or run-time?
Which version of VS are you using?
Did you perhaps edit the Designer generated code and remove something you shouldn't have? VS does such a poor job of cleaning up, sometimes I have had to go into the designer generated code and remove code for controls that no longer exist and in the process have accidentally deleted code that I didn't intend. This has led to some very strange results from those deletions. Just a thought.
@jayman, all the controls are added at design time, none @ runtime. It has to be the frmBrowser file because I added it to a totally new project and the same thing happened, which means I get to start all over again from scratch
I never found what was causing it, seems it was something in the form designer or the initilizecompoinent call when the form loaded. I had to delete the form and start all over again. I figured it better to spend 2 hours recreating a form than 4 trying to find out why it was disappearing in the first place. It was definitely odd to say the least.