Click here to Skip to main content
15,922,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
Friend i need a simple code.

For back button in C# windows Application

i have written this code
{
Console.writeline(@"from2");
}


its not giving me error but at runtime it is not going back please help to correct it

Thanks in advance
Posted
Updated 5-Oct-10 23:09pm
v2

Use Like this

Form2 frm2=new Form2();

frm2.Show();
 
Share this answer
 
Comments
aayu 6-Oct-10 5:22am    
hey thank for quick reply
Hiren solanki 6-Oct-10 5:25am    
no need to write same answer again.
aayu 6-Oct-10 6:13am    
Hiren you both have replayed together i think so
Hiren solanki 6-Oct-10 7:06am    
there were 2 min difference.
aayu 6-Oct-10 8:05am    
then i can say Mohd wasif was first to answer hiren :)
It is not like that in windows application like we are using in web
i.e Response.Redirect("abc.aspx");


You cannot use
Console.WriteLine(@"pagename");

in WinForms to redirect but for that you need to have form object and use Show Method of form Class.
i.e.
Form2 form2 = new Form2();
form2.show();


Please vote and Accept Answer if it Helped.
 
Share this answer
 
Comments
aayu 6-Oct-10 5:23am    
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900