Click here to Skip to main content
16,004,889 members
Home / Discussions / C#
   

C#

 
QuestionSystem.Drawing Pin
dsl/fahk7-Feb-07 16:00
dsl/fahk7-Feb-07 16:00 
AnswerRe: System.Drawing Pin
Christian Graus7-Feb-07 16:16
protectorChristian Graus7-Feb-07 16:16 
AnswerRe: System.Drawing Pin
Judah Gabriel Himango7-Feb-07 16:23
sponsorJudah Gabriel Himango7-Feb-07 16:23 
QuestionReg. exe file icon Pin
Sri harini7-Feb-07 15:40
Sri harini7-Feb-07 15:40 
QuestionHow to pass reference Pin
Member 38068457-Feb-07 14:58
Member 38068457-Feb-07 14:58 
AnswerRe: How to pass reference Pin
Christian Graus7-Feb-07 15:11
protectorChristian Graus7-Feb-07 15:11 
AnswerRe: How to pass reference Pin
sysrev8-Feb-07 0:39
sysrev8-Feb-07 0:39 
Questionform.close() not working Pin
red60mans7-Feb-07 14:13
red60mans7-Feb-07 14:13 
Hi,
I am using visual studio team suite 2005 for developing a windows app in C#

I have 2 forms Form1 and Form2

I have a button control on Form1 called Bttn. In the click event of the button i am writing the following code so that i close the current Form i.e. Form1 and want to show Form2.

MY code::

Form1 f = new Form1();
f.Close();

Form2 r = new Form2();
r.Visible = true;


but with this i have 2 problems
1) Form1 is not closed and Form2 is open i.e. both forms are opened (f.close() is not working)
2) After running the app, when i close Form1 Strangely Form2 is also closed.
but however if i close Form2 only that form2 is closed as expected. I am not implementing any mdi forms concept.

Any help is appreciated
thanks red



yojimbo
AnswerRe: form.close() not working Pin
Christian Graus7-Feb-07 14:33
protectorChristian Graus7-Feb-07 14:33 
GeneralRe: form.close() not working Pin
red60mans7-Feb-07 14:58
red60mans7-Feb-07 14:58 
GeneralRe: form.close() not working Pin
Luc Pattyn7-Feb-07 15:04
sitebuilderLuc Pattyn7-Feb-07 15:04 
GeneralRe: form.close() not working Pin
Christian Graus7-Feb-07 15:14
protectorChristian Graus7-Feb-07 15:14 
GeneralRe: form.close() not working Pin
Christian Graus7-Feb-07 15:15
protectorChristian Graus7-Feb-07 15:15 
QuestionRe: form.close() not working Pin
red60mans7-Feb-07 17:24
red60mans7-Feb-07 17:24 
AnswerRe: form.close() not working Pin
ShermansLagoon7-Feb-07 21:00
ShermansLagoon7-Feb-07 21:00 
AnswerRe: form.close() not working Pin
Christian Graus7-Feb-07 21:09
protectorChristian Graus7-Feb-07 21:09 
QuestionSpace Elevator Problem Pin
Member 38066887-Feb-07 13:34
Member 38066887-Feb-07 13:34 
AnswerRe: Space Elevator Problem Pin
Dave Kreskowiak7-Feb-07 14:09
mveDave Kreskowiak7-Feb-07 14:09 
AnswerRe: Space Elevator Problem [modified] Pin
Not Active7-Feb-07 14:11
mentorNot Active7-Feb-07 14:11 
GeneralRe: Space Elevator Problem Pin
Christian Graus7-Feb-07 14:16
protectorChristian Graus7-Feb-07 14:16 
GeneralRe: Space Elevator Problem Pin
Not Active7-Feb-07 14:23
mentorNot Active7-Feb-07 14:23 
AnswerRe: Space Elevator Problem Pin
Christian Graus7-Feb-07 14:15
protectorChristian Graus7-Feb-07 14:15 
QuestionLeave event not firing Pin
kumar.bs7-Feb-07 13:32
kumar.bs7-Feb-07 13:32 
AnswerRe: Leave event not firing Pin
Dave Kreskowiak7-Feb-07 14:05
mveDave Kreskowiak7-Feb-07 14:05 
GeneralRe: Leave event not firing Pin
kumar.bs7-Feb-07 14:27
kumar.bs7-Feb-07 14:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.