close current form and show another form

P

ponnurajs

In my application, i need to close the current form and want to show
the new form. But i can't achieve this. In my code, the form1 is
closed, and at the same time form2 is also closed.
any one can u give solution for this.

my code is like,

private sub btnClose_keydown(parameters) handles btnclose.keydown
me.close
dim oFrm2 as new Form2
ofrm2.show
end sub
 
W

Will Chapman

In my application, i need to close the current form and want to show
the new form. But i can't achieve this. In my code, the form1 is
closed, and at the same time form2 is also closed.
any one can u give solution for this.

my code is like,

private sub btnClose_keydown(parameters) handles btnclose.keydown
me.close
dim oFrm2 as new Form2
ofrm2.show
end sub
Have you tried
form1.hide
form2.show

I haven't but its my most immediate thought..

Will Chapman
 
P

ponnurajs

Hai chapman! Thanks for your reply.

I tried that hide with

me.hide()
form2obj.show()

it is working properly, But in form1 i have a timer control, that
is enable after closing that form. So, i can't use this way.

Now, i am doing like this, before hide the form, i am disposing
the timer control in that form, and showing another form.

I don't want to do like this. Just i want to close that form, in
that all the controls avaialbe in that also disposed.

can u give any idea for this.

Ponnuraj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top