Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I need some help, please.. :)

 

I am currently in the process of writing a Setup Wizard for my software. I need to to jump from a form called Step1 to Step2 and vice verce. I am using the following syntax:

 

Step1 t = new Step1();

t.ShowDialog();

t.close();

 

It actually is hiding the window and not closing it so it's adding up in the taskbar. Is there a way to have it close the window and terminate it from the system memory and taskbar? I have also tried to dispose the form but that doesn't work either.

 

Any help would be greatfully appreciated!

 

Thank you in advance.

  • *Experts*
Posted
ShowDialog causes the form to show modally, so t.Close() will not execute until t closes. The way you have it laid out is a bit of a catch-22 situation, but you can easily fix it. You need to close the form with Me.Close() from within the Step1 form.
Posted

Regardless of whether you meant this.Close() or t.Close(), code execution in that particular routine will stop until the t form has been closed. You should probably explore the differences in the .Show and .ShowDialog methods. If you call t's Show method instead, code execution will continue and this.Close() will be called.

 

BUT, if this contains your application's entry point, calling Close() will cause your application to exit, thus closing with it the new t form. :) You could call this.Hide() instead.

  • 3 weeks later...
Posted

Me.Close is vb's version of C#'s this.Close();

 

if you don't like the taskbar issue showing up when you open the form then change it's ShowInTaskbar property to False

 

brandon

i'm not lazy i'm just resting before i get tired.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...