Click here to Skip to main content
15,919,613 members
Home / Discussions / C#
   

C#

 
GeneralRe: I need your opinions! Pin
theDexter14-Mar-05 8:05
theDexter14-Mar-05 8:05 
QuestionHOW TO SAVE AN OBJECT TO A FILE WITH C# Pin
dexom11-Mar-05 16:44
dexom11-Mar-05 16:44 
AnswerRe: HOW TO SAVE AN OBJECT TO A FILE WITH C# Pin
Angel Reyes11-Mar-05 17:32
Angel Reyes11-Mar-05 17:32 
AnswerRe: HOW TO SAVE AN OBJECT TO A FILE WITH C# Pin
TylerBrinks12-Mar-05 12:37
TylerBrinks12-Mar-05 12:37 
GeneralCodePrject Article Pin
Pooria Madani11-Mar-05 16:21
Pooria Madani11-Mar-05 16:21 
GeneralRe: CodePrject Article Pin
minhpc_bk11-Mar-05 16:36
minhpc_bk11-Mar-05 16:36 
GeneralAdding New Forms and Relaoding Forms Pin
Libert CT11-Mar-05 14:30
sussLibert CT11-Mar-05 14:30 
GeneralRe: Adding New Forms and Relaoding Forms Pin
sreejith ss nair11-Mar-05 22:26
sreejith ss nair11-Mar-05 22:26 
1) You can reload the form while calling the Show() method of the form.
Eg:
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
	 this.Show();<br />
}


2) If you want to show another form from the active form, then you can create the instance of second form and use the Show() method.

Eg:
private void button2_Click(object sender, System.EventArgs e)<br />
{<br />
     Form2 frm=new Form2();<br />
     frm.Show();<br />
}

Here what you need to notice is, your application will always create new instances of Form2 for each button click.

To avoid this, you can add a Form2 Type declaration and can use this member to create instance of the type Form2. So now your application show the second form once for every button click.
Eg:

private Form2 frm;<br />
private void button2_Click(object sender, System.EventArgs e)<br />
{<br />
  if(frm!=null)<br />
	frm.Show();<br />
  else<br />
   {<br />
	frm=new Form2();<br />
	frm.Show();<br />
   }<br />
}
Wink | ;)

Sreejith Nair
[ My Articles ]
GeneralC# dll component to react on a specific url Pin
bossehansen11-Mar-05 11:40
bossehansen11-Mar-05 11:40 
GeneralRe: C# dll component to react on a specific url Pin
Nick Parker11-Mar-05 11:57
protectorNick Parker11-Mar-05 11:57 
GeneralRe: C# dll component to react on a specific url Pin
bossehansen11-Mar-05 21:19
bossehansen11-Mar-05 21:19 
GeneralRe: C# dll component to react on a specific url Pin
Nick Parker12-Mar-05 3:05
protectorNick Parker12-Mar-05 3:05 
GeneralCustom Controls Pin
Kwai Cheng Kane11-Mar-05 9:28
Kwai Cheng Kane11-Mar-05 9:28 
GeneralRe: Custom Controls Pin
Judah Gabriel Himango11-Mar-05 11:36
sponsorJudah Gabriel Himango11-Mar-05 11:36 
GeneralRe: Custom Controls Pin
Kwai Cheng Kane11-Mar-05 12:54
Kwai Cheng Kane11-Mar-05 12:54 
GeneralRe: Custom Controls Pin
Judah Gabriel Himango11-Mar-05 18:34
sponsorJudah Gabriel Himango11-Mar-05 18:34 
GeneralRe: Custom Controls Pin
Kwai Cheng Kane14-Mar-05 5:04
Kwai Cheng Kane14-Mar-05 5:04 
GeneralAnybody else having problems with arrow keys Pin
theDexter11-Mar-05 9:08
theDexter11-Mar-05 9:08 
Generaladding item to default menu on windows form Pin
asayyam Khan11-Mar-05 8:11
asayyam Khan11-Mar-05 8:11 
GeneralRe: adding item to default menu on windows form Pin
Pooria Madani11-Mar-05 16:23
Pooria Madani11-Mar-05 16:23 
Generalipconfig commands in C# Pin
Vodstok11-Mar-05 6:07
Vodstok11-Mar-05 6:07 
GeneralRe: ipconfig commands in C# Pin
Dave Kreskowiak11-Mar-05 7:12
mveDave Kreskowiak11-Mar-05 7:12 
GeneralGDI+ Gradients Pin
C Flat11-Mar-05 5:50
C Flat11-Mar-05 5:50 
GeneralRe: GDI+ Gradients Pin
TylerBrinks11-Mar-05 6:05
TylerBrinks11-Mar-05 6:05 
GeneralRe: GDI+ Gradients Pin
C Flat11-Mar-05 6:31
C Flat11-Mar-05 6:31 

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.