close current form and show another form

  • Thread starter Thread starter ponnurajs
  • Start date Start date
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
 
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
 
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
 
Back
Top