Click here to Skip to main content
15,918,193 members
Home / Discussions / C#
   

C#

 
AnswerRe: Override desktop context menu Pin
Giorgi Dalakishvili11-Feb-09 4:56
mentorGiorgi Dalakishvili11-Feb-09 4:56 
GeneralRe: Override desktop context menu Pin
pmcons11-Feb-09 5:31
pmcons11-Feb-09 5:31 
QuestionA New Language In C# Pin
jas0n2311-Feb-09 3:50
jas0n2311-Feb-09 3:50 
AnswerRe: A New Language In C# Pin
musefan11-Feb-09 4:11
musefan11-Feb-09 4:11 
AnswerRe: A New Language In C# Pin
Pete O'Hanlon11-Feb-09 4:29
mvePete O'Hanlon11-Feb-09 4:29 
AnswerRe: A New Language In C# Pin
riced11-Feb-09 4:46
riced11-Feb-09 4:46 
GeneralRe: A New Language In C# Pin
PIEBALDconsult11-Feb-09 4:59
mvePIEBALDconsult11-Feb-09 4:59 
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 

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.