Click here to Skip to main content
15,913,055 members
Home / Discussions / C#
   

C#

 
GeneralChanging menu bars color Pin
MeterMan4-Apr-04 16:34
MeterMan4-Apr-04 16:34 
GeneralRe: Changing menu bars color Pin
Heath Stewart4-Apr-04 18:00
protectorHeath Stewart4-Apr-04 18:00 
GeneralRe: Changing menu bars color Pin
MeterMan4-Apr-04 19:09
MeterMan4-Apr-04 19:09 
GeneralMaking menu Item bring and kill focus Pin
MeterMan4-Apr-04 16:28
MeterMan4-Apr-04 16:28 
GeneralRe: Making menu Item bring and kill focus Pin
Heath Stewart4-Apr-04 17:52
protectorHeath Stewart4-Apr-04 17:52 
GeneralRe: Making menu Item bring and kill focus Pin
MeterMan4-Apr-04 19:12
MeterMan4-Apr-04 19:12 
GeneralRe: Making menu Item bring and kill focus Pin
Heath Stewart4-Apr-04 19:18
protectorHeath Stewart4-Apr-04 19:18 
GeneralRe: Making menu Item bring and kill focus Pin
LongRange.Shooter5-Apr-04 9:18
LongRange.Shooter5-Apr-04 9:18 
One approach that you could take (if it fits in with your application design) is to make the main form an MdiParent and make the other forms MdiChild forms.

When either choice is clicked the first step each option would take is to issue a CloseAllChildren() call. The logic for the parent form for this method is as follows:

private void CloseAllChildren()
{
  System.Windows.Forms.Form[] myChildren = this.MdiChildren;
  foreach (Form child in myChildren)
  {
      child.Close();
  }
  return;
}


If you children have any valuable resources that they should release, you can add a trap on the Closing Event.

public void Form1_Closing(object sender, System.EventArgs e)
{
    ... release resources ...
    ... if user did not save see if they really want to throw
        awway their work
    // user wants to save data...do not close this form
    e.CloseCancel = true;
}


___________________
Forgoing antagonism and separation, one enters into the harmonious oneness of all things. Lao Tzu
GeneralShockwave Flash in Windows Application!! Pin
Imad_4u4-Apr-04 15:40
Imad_4u4-Apr-04 15:40 
GeneralRe: Shockwave Flash in Windows Application!! Pin
Heath Stewart4-Apr-04 17:45
protectorHeath Stewart4-Apr-04 17:45 
GeneralRe: Shockwave Flash in Windows Application!! Pin
Jeremy Kimball5-Apr-04 3:44
Jeremy Kimball5-Apr-04 3:44 
GeneralControl Windows Key on Keyboard Pin
Member 6910894-Apr-04 15:04
Member 6910894-Apr-04 15:04 
GeneralRe: Control Windows Key on Keyboard Pin
Heath Stewart4-Apr-04 17:39
protectorHeath Stewart4-Apr-04 17:39 
GeneralRe: Control Windows Key on Keyboard Pin
Member 6910895-Apr-04 7:13
Member 6910895-Apr-04 7:13 
GeneralStartUp Folder?! Pin
Morten Kristensen4-Apr-04 14:28
Morten Kristensen4-Apr-04 14:28 
GeneralRe: StartUp Folder?! Pin
Heath Stewart4-Apr-04 17:29
protectorHeath Stewart4-Apr-04 17:29 
GeneralRe: StartUp Folder?! Pin
Morten Kristensen5-Apr-04 0:28
Morten Kristensen5-Apr-04 0:28 
GeneralAutoScroll on tabpage and animated cursor Pin
Flack4-Apr-04 11:18
Flack4-Apr-04 11:18 
GeneralRe: AutoScroll on tabpage and animated cursor Pin
Heath Stewart4-Apr-04 12:59
protectorHeath Stewart4-Apr-04 12:59 
GeneralRe: AutoScroll on tabpage and animated cursor Pin
Flack4-Apr-04 17:38
Flack4-Apr-04 17:38 
GeneralRe: AutoScroll on tabpage and animated cursor Pin
Heath Stewart4-Apr-04 17:43
protectorHeath Stewart4-Apr-04 17:43 
GeneralFlickering Controls and Non Transparent Corners Pin
Tristan Rhodes4-Apr-04 10:36
Tristan Rhodes4-Apr-04 10:36 
GeneralRe: Flickering Controls and Non Transparent Corners Pin
Nick Parker4-Apr-04 11:16
protectorNick Parker4-Apr-04 11:16 
GeneralRe: Flickering Controls and Non Transparent Corners Pin
Tristan Rhodes4-Apr-04 11:43
Tristan Rhodes4-Apr-04 11:43 
Questioncreate "washed out" images? Pin
pgraeve4-Apr-04 10:07
pgraeve4-Apr-04 10:07 

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.