Click here to Skip to main content
15,904,416 members
Home / Discussions / C#
   

C#

 
QuestionSend data from textbox to datagridview in a diferent form Pin
ZRF6911-Feb-09 3:58
ZRF6911-Feb-09 3:58 
AnswerRe: Send data from textbox to datagridview in a diferent form Pin
ByteBlocks11-Feb-09 4:09
ByteBlocks11-Feb-09 4:09 
AnswerRe: Send data from textbox to datagridview in a diferent form Pin
musefan11-Feb-09 4:16
musefan11-Feb-09 4:16 
AnswerRe: Send data from textbox to datagridview in a diferent form [modified] Pin
DaveyM6911-Feb-09 9:48
professionalDaveyM6911-Feb-09 9:48 
AnswerRe: Send data from textbox to datagridview in a diferent form Pin
Deresen11-Feb-09 10:12
Deresen11-Feb-09 10:12 
QuestionOverride desktop context menu [modified] Pin
pmcons11-Feb-09 3:55
pmcons11-Feb-09 3:55 
AnswerRe: Override desktop context menu Pin
jas0n2311-Feb-09 4:02
jas0n2311-Feb-09 4:02 
GeneralRe: Override desktop context menu Pin
pmcons11-Feb-09 4:06
pmcons11-Feb-09 4:06 
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 

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.