Click here to Skip to main content
15,905,325 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to close all form but not application.exit() Pin
OriginalGriff11-Feb-10 5:09
mveOriginalGriff11-Feb-10 5:09 
GeneralRe: How to close all form but not application.exit() Pin
N a v a n e e t h11-Feb-10 5:24
N a v a n e e t h11-Feb-10 5:24 
GeneralRe: How to close all form but not application.exit() Pin
OriginalGriff11-Feb-10 5:38
mveOriginalGriff11-Feb-10 5:38 
AnswerRe: How to close all form but not application.exit() Pin
OriginalGriff11-Feb-10 5:08
mveOriginalGriff11-Feb-10 5:08 
GeneralRe: How to close all form but not application.exit() Pin
nuttynibbles11-Feb-10 5:21
nuttynibbles11-Feb-10 5:21 
GeneralRe: How to close all form but not application.exit() Pin
OriginalGriff11-Feb-10 5:32
mveOriginalGriff11-Feb-10 5:32 
GeneralRe: How to close all form but not application.exit() Pin
nuttynibbles11-Feb-10 5:46
nuttynibbles11-Feb-10 5:46 
GeneralRe: How to close all form but not application.exit() Pin
OriginalGriff11-Feb-10 5:55
mveOriginalGriff11-Feb-10 5:55 
Store them as part of your main form, as either an array of Form objects, or as individual YourForm references. At the moment, you do something like
YourForm yf = new YourForm();
yf.Show();
when the use clicks one of your list view entries - just move the "YourForm yf" outside the method (and give it a better name).
You then change it to
yf = new YourForm();
yf.FormClosing += new EventHandler(YourFormClosing);
yf.Show();
and add
private void YourFormClosing(object sender, EventArgs e)
   {
   yf = null;
   }
to remove it when it closes.
You can then check
if (yf != null)
   {
   yf.Close();
   }
If Barbie is so popular, why do you have to buy her friends?

Eagles may soar, but weasels don't get sucked into jet engines.

If at first you don't succeed, destroy all evidence that you tried.

GeneralRe: How to close all form but not application.exit() Pin
nuttynibbles11-Feb-10 6:02
nuttynibbles11-Feb-10 6:02 
AnswerRe: How to close all form but not application.exit() Pin
#realJSOP11-Feb-10 6:00
professional#realJSOP11-Feb-10 6:00 
AnswerRe: How to close all form but not application.exit() Pin
SilimSayo11-Feb-10 9:17
SilimSayo11-Feb-10 9:17 
QuestionUsing Semaphore for multiple threads.... Pin
Jacob Dixon11-Feb-10 4:45
Jacob Dixon11-Feb-10 4:45 
AnswerRe: Using Semaphore for multiple threads.... Pin
N a v a n e e t h11-Feb-10 5:22
N a v a n e e t h11-Feb-10 5:22 
GeneralRe: Using Semaphore for multiple threads.... Pin
Jacob Dixon11-Feb-10 5:37
Jacob Dixon11-Feb-10 5:37 
AnswerRe: Using Semaphore for multiple threads.... Pin
Covean11-Feb-10 5:25
Covean11-Feb-10 5:25 
GeneralRe: Using Semaphore for multiple threads.... Pin
Jacob Dixon11-Feb-10 5:40
Jacob Dixon11-Feb-10 5:40 
GeneralRe: Using Semaphore for multiple threads.... Pin
Jacob Dixon11-Feb-10 5:42
Jacob Dixon11-Feb-10 5:42 
GeneralRe: Using Semaphore for multiple threads.... Pin
Covean12-Feb-10 0:13
Covean12-Feb-10 0:13 
QuestionCreating a live service in c# Pin
Steve-Co11-Feb-10 4:29
Steve-Co11-Feb-10 4:29 
AnswerRe: Creating a live service in c# Pin
#realJSOP11-Feb-10 6:03
professional#realJSOP11-Feb-10 6:03 
GeneralRe: Creating a live service in c# Pin
Steve-Co11-Feb-10 23:32
Steve-Co11-Feb-10 23:32 
GeneralRe: Creating a live service in c# Pin
#realJSOP12-Feb-10 8:27
professional#realJSOP12-Feb-10 8:27 
GeneralRe: Creating a live service in c# Pin
#realJSOP14-Feb-10 8:19
professional#realJSOP14-Feb-10 8:19 
Questionaspx to Html page Pin
It_tech11-Feb-10 1:19
It_tech11-Feb-10 1:19 
AnswerRe: aspx to Html page Pin
loyal ginger11-Feb-10 1:33
loyal ginger11-Feb-10 1:33 

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.