Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
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 
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 
Ah. That worked. Took a bit of tinkering though.

Users have 2 ways of closing the form. 1 is with the [X] and the other is automatic, when they leave a textbox (the windows pop up when they enter a textbox).

Original close code ->

public void CloseA()
{
formA.Dispose();
formA.Close();
formA = null;
}

This worked, until they closed with the [X] (discussed above).

I added your event handler code, which just set the private formA variable back to null, nothing else.

Problem with that was, when they left a textbox, it was running the close function and trying to dispose/close the form, but the event handler must have triggered first (I wasn't sure how to call the event handler directly from outside the class , formA_Closed(null, null) didn't seem to work).

Long story short, I checked if (formA != null), then dispose/close in the original CloseA() function. All is merry now.

Thanks again.
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 
AnswerRe: Sending info to command line [modified] Pin
Eric Dahlvang15-Jun-06 11:16
Eric Dahlvang15-Jun-06 11: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.