Hi,

I have a little issue that I need some light shed on please.

I have 2 forms; StartUp and MainForm.

When the application starts with the StartUp form the forms load section check to see if a file exists, if it does, it closes and opens the MainForm using the code below:-

MainForm form = new MainForm();
			form.ShowDialog();
			this.Close();

That all works brilliantly and if the file does exist the application runs straight to the MainForm without showing the StartUp form at all.

However, I have been trying to implement this same piece of code onto a button click event on my StartUp form and this is where it breaks down.

Upon clicking the button, the MainForm loads fine but the StartUp form is still displayed albeit behind the MainForm.

What would be causing this to happen?

How can I rectify it so the StartUp form does actually close on this button click?

Kind regards..,

MT ;)

MainForm form = new MainForm();
form.ShowDialog();
this.hide();

think of it like this you tell R2D2 to call C3PO and do somthing, but as soon C3PO is called R2D2 shuts down without relaying the message?

make sense?

No ok here is a better solution.

http://www.youtube.com/watch?v=oHg5SJYRHA0

OK, what has Rick Astley got to do with it?

this.Hide();
this.dispose();

Thanks for replying but I have tried it this way also and still the same result.

I have now found a work around though.

Kind regards..,

MT ;)

Get a life!

comon dude just messin around.

Please post your solution, so you may help someone else.

This question has already been answered. Start a new discussion instead.