Click here to Skip to main content
15,895,667 members
Home / Discussions / C#
   

C#

 
AnswerRe: A New Language In C# Pin
PIEBALDconsult11-Feb-09 5:05
mvePIEBALDconsult11-Feb-09 5:05 
GeneralRe: A New Language In C# Pin
jas0n2323-Apr-09 5:04
jas0n2323-Apr-09 5:04 
AnswerRe: A New Language In C# Pin
Guffa11-Feb-09 6:53
Guffa11-Feb-09 6:53 
QuestionForm Pin
mrithula811-Feb-09 2:36
mrithula811-Feb-09 2:36 
AnswerRe: Form Pin
EliottA11-Feb-09 2:40
EliottA11-Feb-09 2:40 
AnswerRe: Form Pin
musefan11-Feb-09 2:48
musefan11-Feb-09 2:48 
GeneralRe: Form Pin
mrithula811-Feb-09 2:51
mrithula811-Feb-09 2:51 
GeneralRe: Form Pin
musefan11-Feb-09 3:00
musefan11-Feb-09 3:00 
ok here is my suggestion for you to think about:

Create a static class that holds form instances i.e.

Form1 form1 = new Form1;
Form2 form2 = new Form2;
Form3 form3 = new Form3;
...



Create a private static function for hiding all the forms i.e.

private static void HideAll()
{
if(form1 != null && !form1.Disposed && form1.Visible)
   form1.Hide();
...
}


Next create a public static function for displaying the desired form i.e.

public static void ShowForm(int formNum)
{
HideAll();
switch(formNum)
{
  case 1:
      form1.Show();
  break;
  ...
}
}



Then whenever you handle a button click you can do...

StaticForm.ShowForm(1);//to show Form1 only


If only MySelf.Visible was more than just a getter...

A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting

AnswerRe: Form Pin
Alan N11-Feb-09 3:35
Alan N11-Feb-09 3:35 
GeneralRe: Form Pin
mrithula811-Feb-09 18:16
mrithula811-Feb-09 18:16 
GeneralRe: Form [modified] Pin
Alan N12-Feb-09 0:30
Alan N12-Feb-09 0:30 
Answerit is easy look here Pin
erfi12-Feb-09 0:27
erfi12-Feb-09 0:27 
QuestionRE: Datagrid with check box Pin
chandhuBTS11-Feb-09 1:36
chandhuBTS11-Feb-09 1:36 
QuestionCarraige Return Issue Pin
MumbleB11-Feb-09 1:34
MumbleB11-Feb-09 1:34 
AnswerRe: Carraige Return Issue [modified] Pin
ABitSmart11-Feb-09 1:44
ABitSmart11-Feb-09 1:44 
AnswerRe: Carraige Return Issue Pin
musefan11-Feb-09 1:49
musefan11-Feb-09 1:49 
AnswerRe: Carraige Return Issue Pin
Guffa11-Feb-09 2:01
Guffa11-Feb-09 2:01 
GeneralRe: Carraige Return Issue Pin
MumbleB11-Feb-09 2:10
MumbleB11-Feb-09 2:10 
GeneralRe: Carraige Return Issue Pin
Guffa11-Feb-09 6:34
Guffa11-Feb-09 6:34 
AnswerRe: Carraige Return Issue Pin
Luc Pattyn11-Feb-09 11:44
sitebuilderLuc Pattyn11-Feb-09 11:44 
JokeRe: Carraige Return Issue Pin
Guffa12-Feb-09 19:28
Guffa12-Feb-09 19:28 
QuestionC# Image Printing Pin
scotlandc11-Feb-09 1:27
scotlandc11-Feb-09 1:27 
AnswerRe: C# Image Printing Pin
musefan11-Feb-09 1:38
musefan11-Feb-09 1:38 
GeneralRe: C# Image Printing Pin
scotlandc11-Feb-09 1:41
scotlandc11-Feb-09 1:41 
GeneralRe: C# Image Printing Pin
musefan11-Feb-09 1:46
musefan11-Feb-09 1:46 

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.