Click here to Skip to main content
15,916,091 members
Home / Discussions / C#
   

C#

 
GeneralRe: Fairly easy task (I think), but difficult to explain (plus I'm sort of a newbie) Pin
Josh Smith15-Jun-06 11:43
Josh Smith15-Jun-06 11:43 
GeneralRe: Fairly easy task (I think), but difficult to explain (plus I'm sort of a newbie) Pin
ThisIsMyUserName215-Jun-06 12:30
ThisIsMyUserName215-Jun-06 12:30 
AnswerRe: Fairly easy task (I think), but difficult to explain (plus I'm sort of a newbie) Pin
Alexander Wiseman15-Jun-06 11:24
Alexander Wiseman15-Jun-06 11:24 
GeneralRe: Fairly easy task (I think), but difficult to explain (plus I'm sort of a newbie) Pin
Alexander Wiseman15-Jun-06 11:29
Alexander Wiseman15-Jun-06 11:29 
GeneralRe: Fairly easy task (I think), but difficult to explain (plus I'm sort of a newbie) Pin
ThisIsMyUserName215-Jun-06 12:12
ThisIsMyUserName215-Jun-06 12:12 
GeneralRe: Fairly easy task (I think), but difficult to explain (plus I'm sort of a newbie) Pin
Alexander Wiseman15-Jun-06 12:22
Alexander Wiseman15-Jun-06 12:22 
GeneralRe: Fairly easy task (I think), but difficult to explain (plus I'm sort of a newbie) Pin
ThisIsMyUserName215-Jun-06 12:39
ThisIsMyUserName215-Jun-06 12:39 
GeneralRe: Fairly easy task (I think), but difficult to explain (plus I'm sort of a newbie) Pin
Alexander Wiseman15-Jun-06 12:47
Alexander Wiseman15-Jun-06 12:47 
When you close a form with the [X], two events occur: first Closing and second Closed. Simply add an event handler inside Class2 for one of these events (probably the second one would be better) and set the variable to null there, or whatever else needs resetting.

Here is some sample code:
public void ShowA(string displayValue)
{
     if(formA == null)
     {
          formA = new MainForm();
          ...
          formA.Closed += new EventHandler(formA_Closed);
...
formA_Closed refers to a function inside Class2 which must have the following signature (i.e. parameters):
public void formA_Closed(object sender, EventArgs e)
Inside that function, reset whatever you need to.

Hope that helps!

Sincerely,
Alexander Wiseman
GeneralRe: Fairly easy task (I think), but difficult to explain (plus I'm sort of a newbie) Pin
ThisIsMyUserName215-Jun-06 13:21
ThisIsMyUserName215-Jun-06 13:21 
QuestionUsing RPC (with IDL) from C# Pin
BambooMoon15-Jun-06 9:55
BambooMoon15-Jun-06 9:55 
QuestionDataGridView custom Column Pin
Mike0915-Jun-06 8:56
Mike0915-Jun-06 8:56 
Questiondatagrid and databinding (long due to code) Pin
leckey15-Jun-06 8:51
leckey15-Jun-06 8:51 
AnswerRe: datagrid and databinding (long due to code) Pin
Josh Smith15-Jun-06 9:18
Josh Smith15-Jun-06 9:18 
QuestionSending info to command line Pin
ddpn4215-Jun-06 8:47
ddpn4215-Jun-06 8:47 
AnswerRe: Sending info to command line Pin
Alexander Wiseman15-Jun-06 8:54
Alexander Wiseman15-Jun-06 8:54 
GeneralRe: Sending info to command line Pin
Josh Smith15-Jun-06 9:02
Josh Smith15-Jun-06 9:02 
GeneralRe: Sending info to command line [modified] Pin
ddpn4215-Jun-06 9:21
ddpn4215-Jun-06 9:21 
GeneralRe: Sending info to command line Pin
Alexander Wiseman15-Jun-06 9:25
Alexander Wiseman15-Jun-06 9:25 
GeneralRe: Sending info to command line Pin
ddpn4215-Jun-06 10:02
ddpn4215-Jun-06 10:02 
GeneralRe: Sending info to command line Pin
Dustin Metzgar15-Jun-06 10:15
Dustin Metzgar15-Jun-06 10:15 
AnswerRe: Sending info to command line [modified] Pin
Alexander Wiseman15-Jun-06 10:23
Alexander Wiseman15-Jun-06 10:23 
AnswerRe: Sending info to command line Pin
Dustin Metzgar15-Jun-06 9:01
Dustin Metzgar15-Jun-06 9:01 
GeneralRe: Sending info to command line Pin
Dustin Metzgar15-Jun-06 9:05
Dustin Metzgar15-Jun-06 9:05 
AnswerRe: Sending info to command line Pin
Eric Dahlvang15-Jun-06 10:14
Eric Dahlvang15-Jun-06 10:14 
GeneralRe: Sending info to command line Pin
ddpn4215-Jun-06 10:53
ddpn4215-Jun-06 10:53 

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.