Open and close forms

form transitions

Page 1 of 1

4 Replies - 13809 Views - Last Post: 29 March 2008 - 06:45 AM Rate Topic: -----

#1 jabarian  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 14-February 08

Open and close forms

Post icon  Posted 18 February 2008 - 09:16 AM

Hi there, I'm trying to create a commerce program, when the program loads the user is faced with a main screen, when a user selects a button i want the new form to open and the last one to close, I can open a new form no problem yet i cant get the old one to close, Ive tried the following options.


Dim f1 As New Form 1 (this is the new form)
f1.show()
Dim f2 As New Form 2 (old form)
f2.close()




I have also tried .hide yet nothing the old form just remains open

I've even tried this code in the new form window yet no joy.

Anybody have any ideas

Thanks for reading

Is This A Good Question/Topic? 0
  • +

Replies To: Open and close forms

#2 jabarian  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 14-February 08

Re: Open and close forms

Posted 18 February 2008 - 10:43 AM

View Postjabarian, on 18 Feb, 2008 - 09:16 AM, said:

Hi there, I'm trying to create a commerce program, when the program loads the user is faced with a main screen, when a user selects a button i want the new form to open and the last one to close, I can open a new form no problem yet i cant get the old one to close, Ive tried the following options.


Dim f1 As New Form 1 (this is the new form)
f1.show()
Dim f2 As New Form 2 (old form)
f2.close()




I have also tried .hide yet nothing the old form just remains open

I've even tried this code in the new form window yet no joy.

Anybody have any ideas

Thanks for reading


Never mind all sorted, thanks
Was This Post Helpful? 1

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Open and close forms

Posted 18 February 2008 - 10:48 AM

I was going to say that in the form you're closing you dont need to create an instance of that form, you can just use:


Form2.Show()
Me.Hide()




You only need to create an instance of another form if you're trying to access controls or methods on that form.
Was This Post Helpful? 0
  • +
  • -

#4 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Open and close forms

Posted 18 February 2008 - 12:44 PM

jabarian, please do not create duplicate topics. I have gone ahead and deleted your other topic in ASP.NET.

Glad you were able to find a solution.
Was This Post Helpful? 0
  • +
  • -

#5 kevinyjk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 01-March 08

Re: Open and close forms

Posted 29 March 2008 - 06:45 AM

View Postjabarian, on 18 Feb, 2008 - 10:43 AM, said:

View Postjabarian, on 18 Feb, 2008 - 09:16 AM, said:

Hi there, I'm trying to create a commerce program, when the program loads the user is faced with a main screen, when a user selects a button i want the new form to open and the last one to close, I can open a new form no problem yet i cant get the old one to close, Ive tried the following options.


Dim f1 As New Form 1 (this is the new form)
f1.show()
Dim f2 As New Form 2 (old form)
f2.close()




I have also tried .hide yet nothing the old form just remains open

I've even tried this code in the new form window yet no joy.

Anybody have any ideas

Thanks for reading


Never mind all sorted, thanks

Hi, i also faced that problem, can i know how you solve the problem? TQ
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1