Displaying a new Form

Discuss anything programming related.
Post Reply
User avatar
Click16
Posts: 1941
Joined: Mon Dec 31, 2007 4:36 am
Location: United States

Displaying a new Form

Post by Click16 »

Hey everyone... I have a problem. I was working on my Halo 2 App when suddenly something stopped me. I went to debug the app, and I got no exceptions. Though I have no exceptions, I had a larger problem. Every time the application starts, the form that is supposed to be displayed is not displayed. Instead, I get a blank form. No title, no contents, It has the standard size which is 300 x 300.

here is what I mean.

the window looks like this:
Image

once i click debug i get this:
http://i26.tinypic.com/2navex1.png


My Program.cs has it set to this:

Code: Select all

...
            Application.Run(new Form1());
        }
    }
}
So I know that it isn't running like this:

Code: Select all

...
            Application.Run(new Form());
        }
    }
}
Let's say that I set it to be a different form, It will run that form. It just seems to fail loading Form1. In response, it runs a complete new form.
Image
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: Displaying a new Form

Post by XZodia »

it appears to be loading form2...
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
Click16
Posts: 1941
Joined: Mon Dec 31, 2007 4:36 am
Location: United States

Re: Displaying a new Form

Post by Click16 »

xzodia wrote:it appears to be loading form2...
no, Form2 is different. It is just loading a NEW FORM. like this:

Code: Select all

Form RandomName = new Form();
RandomName.Show()
Image
User avatar
troymac1ure
Keeper of Entity
Posts: 1282
Joined: Sat Aug 09, 2008 4:16 am
Location: British Columbia, Canada, eh
Contact:

Re: Displaying a new Form

Post by troymac1ure »

What is your main form and is it actually set to that?

Try stepping through the prgram with F11 and see where it starts.
User avatar
OwnZ joO
Posts: 1197
Joined: Sun Dec 09, 2007 4:46 pm

Re: Displaying a new Form

Post by OwnZ joO »

Make sure you didn't remove the call to InitializeComponent in the constructor of Form1 or something like that.
Post Reply