I want to move between forms in c#, but I want to close the form that linked me.
If I have two forms , form1 and form2 I want to move from form1 to form2 and form1 to be closed.
how to do it?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend3days leftRegister
Crew Reynolds8 pointsPosted Aug 10, 2005, 7:23 AM EDT
I'm new at C# so I thought I'd give this a shot. Not as easy as I figured. I created Form1 that then
creates Form2. When I tried to let Form1 unload itself, the app closes. I never could find a way to
have Form2 tell Form1 to close itself. However, if I could, I bet it would close the app as Form1 is
the root (parent) form. Maybe you could use one form and show/hide panels of components in a
"Wizard" next/previous sort of thing. Is that what you're after?
Sorry I don't have a good answer. I'm just getting going and everything is new to me again coming from VB6.
sbugig39 pointsPosted Aug 10, 2005, 11:01 PM EDT
Amr Noureldin10 pointsPosted Aug 14, 2005, 12:24 AM EDT
And when the user clicks on a button [i]continue[/i], you want the page [b]login.aspx[/b] to open, so make an event on the button, and inside the event use this:
Response.Redirect("login.aspx");
Does that answer your question?