473,387 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How do I close current form and open the next form ?

I would like to acheive the following VB6 code in VB.NET

Code in the Form1 - Button1_Click

Dim obj1 as new form2
obj1.Prop = myprop
obj1.show
unload me
Nov 20 '05 #1
5 13506
Look for the thread :
"VB.NET and FORMS (Form.Show, Form.Hide ... ) "

from ge***********@lycos.com

in this group

--

/ Sean the Mc /
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

"prob" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
I would like to acheive the following VB6 code in VB.NET

Code in the Form1 - Button1_Click

Dim obj1 as new form2
obj1.Prop = myprop
obj1.show
unload me

Nov 20 '05 #2
Hi,

Unload me is now Me.Close()

Ken
----------------
"prob" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
I would like to acheive the following VB6 code in VB.NET

Code in the Form1 - Button1_Click

Dim obj1 as new form2
obj1.Prop = myprop
obj1.show
unload me

Nov 20 '05 #3
If you close the current instance ... it closes all the
instances of its child

For ex

Dim x as new form2
x.show
me.close
will never shows form2.. it opens and closes immediately
-----Original Message-----
Hi,

Unload me is now Me.Close()

Ken
----------------
"prob" <an*******@discussions.microsoft.com> wrote in messagenews:04****************************@phx.gbl...
I would like to acheive the following VB6 code in VB.NET

Code in the Form1 - Button1_Click

Dim obj1 as new form2
obj1.Prop = myprop
obj1.show
unload me

.

Nov 20 '05 #4
* "prob" <an*******@discussions.microsoft.com> scripsit:
I would like to acheive the following VB6 code in VB.NET

Code in the Form1 - Button1_Click

Dim obj1 as new form2
obj1.Prop = myprop
obj1.show
unload me


<http://groups.google.com/groups?selm=%23HRMBHBRDHA.2204%40TK2MSFTNGP12.phx. gbl>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #5
On Mon, 3 Nov 2003 15:31:42 -0800, prob wrote:

Dim x as new form2
x.show
me.close
will never shows form2.. it opens and closes immediately


That's because you are probably using Form1 (Me) as your startup form.
When you close that, it closes the whole application.

Create a module and add a sub main to it. In the project properties, set
the startup object as Sub Main.
'Untested
Public Sub Main()
Dim frmMain As New Form1

frmMain.Show

Application.Run()
End Sub

With this method, you must call Application.Exit to close the application.
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andras Gilicz | last post by:
Hi VB fans I'm working on a relatively large project in VB6 with about a dozen forms, including graphs, labels, text boxes, etc. The software itself is actually a flow simulator with more or...
0
by: clu82 | last post by:
I have an MDI app that allows the user to open multiple client address child forms. The user has a child form open that has client id "1001" and the records associated data displayed. If the user...
2
by: chanchito_cojones | last post by:
hi there, I am needing some help with a database I am putting together. The database works off of a main Form, which then has buttons on it that will open up other forms. The problem I am having...
2
by: bpaff | last post by:
Can anyone help me, I am trying to add a close statement to a procedure to close the current and then open the next window. I am working with command8 below. Option Compare Database Private...
3
by: Kimelia | last post by:
I want to create something like wizard, which will ask one question and proceed to the next question. So, it's like showing Form A (Question 1), then when the user press "Next" button, I want to...
1
by: Alpha | last post by:
I have a Window based application that shows up still running in the task manager when I close it. It reaches the "this.close" statement and then it stops at the "}" at the section of the...
4
by: Lerp | last post by:
Hi, I have this sub in which I am trying to get a client name from a second table based on a clientid value in my datalist. I am having problems grabbing the clientid value out of my datalist...
7
by: Alice | last post by:
Hi, In my program, the user can navigate to many different forms. When they go to the next form, I want the form they have left to close. However, the forms aren't closing. Can anyone tell me...
3
by: kev | last post by:
Hi folks, I have a form for registration (frmRegistration) whereby i have two buttons. One is Save which saves record using the OnClick property. I used wizard to create the save button. The...
3
by: godhulirbalaka | last post by:
Dear Sir/Madam, I am new vb 6.0 user. I am developing Shop Management Program. I have a main form with buttons and menus. when i click any button then respective form is open. I want to set a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.