473,473 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to open new Form and close current Form?

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 close Form A (Question 1), and show Form B (Question 2).

Sorry to ask if this is too simple, as I am still learning C#.

Thanks and have a nice day.
Nov 17 '05 #1
3 19218
Hi Kimelia,

i think you went into the wrong way. If you plan
to write a wizard you better should make use of
the Panel Class. For every user input dialog place one
panel within the form. Set all panels Visible = false
but the first panel Visible = true. After
the user filled out the inputs of the first panel
and press next you will hide the first panel and show
the secon and so on and so on.

Hope that helps

Lars Behrmann

_________________
Nothing is impossible. UML is the key for all your problems.
AODL - Make your .net apps OpenOffice ready
http://aodl.sourceforge.net

Kimelia schrieb:
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 close Form A (Question 1), and show Form B (Question 2).

Sorry to ask if this is too simple, as I am still learning C#.

Thanks and have a nice day.


Nov 17 '05 #2
Another way would be to show Form1 and then a completely different Form2.

I did this in the following way for a project.

First, create an "EntryPoint" (or whatever) class:

class EntryPoint{
static void Main(string[] args) {
using(Form1 f1 = new Form1()) {
// do something with form 1
}
using(Form2 f2 = new Form2()) {
// do something with form 2
}
}
}
Second, set this class as the startup object in VS. I did something like
this and it worked well for my purposes.

"Lars Behrmann" <la***********@web.de> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Hi Kimelia,

i think you went into the wrong way. If you plan
to write a wizard you better should make use of
the Panel Class. For every user input dialog place one
panel within the form. Set all panels Visible = false
but the first panel Visible = true. After
the user filled out the inputs of the first panel
and press next you will hide the first panel and show
the secon and so on and so on.

Hope that helps

Lars Behrmann

_________________
Nothing is impossible. UML is the key for all your problems.
AODL - Make your .net apps OpenOffice ready
http://aodl.sourceforge.net

Kimelia schrieb:
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 close Form A (Question 1), and show Form B (Question
2).

Sorry to ask if this is too simple, as I am still learning C#.

Thanks and have a nice day.

Nov 17 '05 #3
Hi,

IIRC there is a library that let you do this. Somebody posted the link here
a time ago, check google groups .

What you can do is hide the calling form before showing the "next" one. but
check first the archives !!!

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Kimelia" <ka**@hotmail.com> wrote in message
news:uC**************@tk2msftngp13.phx.gbl...
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 close Form A (Question 1), and show Form B (Question 2).

Sorry to ask if this is too simple, as I am still learning C#.

Thanks and have a nice day.

Nov 17 '05 #4

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...
3
by: Leonard | last post by:
I have a button on my web app, that opens a help html page. I use this code: HttpContext.Current.Response.Write("<script>") HttpContext.Current.Response.Write("window.open('" & sUrl & "','_new')")...
55
by: Steve Jorgensen | last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of multiple parameters in a Property Let procedure to pass dimensional arguments on the basis that, although it works, it's...
13
by: Seth Spearman | last post by:
Hey guys, I have the following code: '****************************************************** If Not Me.NewRecord Then Dim rs As DAO.Recordset Dim strBookmark As String Set rs =...
6
by: Kenneth Courville | last post by:
Hello, I'm looking for assistance with the Access object model. I know this is VB, but I'm building an Office Add-using C# directed at Access 2002. I'm literate in VB, so you can reply in VB... I...
3
by: stumorgan | last post by:
There is probably an extremely simple answer to this question and I'm just being foolish. I have a main form (let's say FormMain) which opens other forms (let's say Form1, Form2). How do I keep...
4
by: magmike | last post by:
I've created a report for the purpose of printing a one page summary of a record. Of course, when I created the report, it gives me a page on every record. Can I create a button to open that report...
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...
3
by: rajashekar4dotnet | last post by:
how to open one form from the other form and close the first form if there are only two forms in windows application(VB.net) i had tried this method dim f as new form2 form2.show( )...
1
by: plumba | last post by:
I have a form which I would like to open in a window with no address bar, tool bar etc etc. I've used the below code for this: function delayer(){ newurl = "testpage.html"...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.