Click here to Skip to main content
15,903,201 members
Home / Discussions / C#
   

C#

 
Questionpath Pin
nelsonpaixao6-Jul-08 13:30
nelsonpaixao6-Jul-08 13:30 
AnswerRe: path Pin
Bram van Kampen6-Jul-08 14:02
Bram van Kampen6-Jul-08 14:02 
QuestionRead Excel Pin
mehrdadc486-Jul-08 9:08
mehrdadc486-Jul-08 9:08 
AnswerRe: Read Excel Pin
Christian Graus6-Jul-08 9:19
protectorChristian Graus6-Jul-08 9:19 
AnswerRe: Read Excel Pin
DaveyM696-Jul-08 9:26
professionalDaveyM696-Jul-08 9:26 
AnswerRe: Read Excel Pin
5do86-Jul-08 16:24
5do86-Jul-08 16:24 
GeneralRe: Read Excel Pin
Christian Graus6-Jul-08 16:40
protectorChristian Graus6-Jul-08 16:40 
QuestionDisable form when closing child form Pin
Deresen6-Jul-08 7:05
Deresen6-Jul-08 7:05 
Hello everyone,

I have an question about forms in C#.
This is a problem which I have had since the start of programming in C#.

This is the problem:
In the (main) Form there is a button to open another (child) Form.
But when I use that Form I would like to have the main Form to be enabled. This is no problem. But when I close the child Form I would like to disable the main Form.
But I want the main form to do this.

So not something like this:
//Form main:
public void createForm(){
Child child = new Child(this);
child.show();
this.Enabled = true;
}
public void show(){
this.Enabled = false;
}
//Form child
public Child(Main m){
this.main = m;
}
public void Dispose(){
main.show();
}


I would rather like to have something like this:
//Form main
public void createForm(){
Child child = new Child();
child.show();
this.Enabled = true;
}
public void child_Disposed(object sender, EventArgs e){
this.Enabled = false;
}


If I'm not wrong, I'll have to work with delegates. But I don't know how, can somebody help me?
AnswerRe: Disable form when closing child form Pin
Harvey Saayman6-Jul-08 7:28
Harvey Saayman6-Jul-08 7:28 
AnswerRe: Disable form when closing child form Pin
N a v a n e e t h6-Jul-08 7:29
N a v a n e e t h6-Jul-08 7:29 
Questionproblem with converting to Double Pin
Rick van Woudenberg6-Jul-08 7:01
Rick van Woudenberg6-Jul-08 7:01 
AnswerRe: problem with converting to Double Pin
Deresen6-Jul-08 7:13
Deresen6-Jul-08 7:13 
AnswerRe: problem with converting to Double Pin
Luc Pattyn6-Jul-08 7:23
sitebuilderLuc Pattyn6-Jul-08 7:23 
QuestionHow Do I Save the Contents of a WebPage without using A WebBrowser? Pin
That Asian Guy6-Jul-08 6:40
That Asian Guy6-Jul-08 6:40 
AnswerRe: How Do I Save the Contents of a WebPage without using A WebBrowser? Pin
Luc Pattyn6-Jul-08 7:24
sitebuilderLuc Pattyn6-Jul-08 7:24 
QuestionCheck for the status of Windows Form Pin
ASysSolvers6-Jul-08 4:21
ASysSolvers6-Jul-08 4:21 
AnswerRe: Check for the status of Windows Form Pin
Luc Pattyn6-Jul-08 4:43
sitebuilderLuc Pattyn6-Jul-08 4:43 
QuestionIs Interface implementation Correct Pin
Navneet Hegde6-Jul-08 3:37
Navneet Hegde6-Jul-08 3:37 
AnswerRe: Is Interface implementation Correct Pin
leppie6-Jul-08 3:52
leppie6-Jul-08 3:52 
Questioncan i drive a class from a delegate Pin
Pankaj Garg6-Jul-08 3:29
Pankaj Garg6-Jul-08 3:29 
AnswerRe: can i drive a class from a delegate Pin
leppie6-Jul-08 3:53
leppie6-Jul-08 3:53 
AnswerRe: can i drive a class from a delegate Pin
leppie6-Jul-08 3:55
leppie6-Jul-08 3:55 
GeneralRe: can i drive a class from a delegate Pin
Pete O'Hanlon6-Jul-08 8:55
mvePete O'Hanlon6-Jul-08 8:55 
GeneralRe: can i drive a class from a delegate Pin
leppie6-Jul-08 9:17
leppie6-Jul-08 9:17 
GeneralRe: can i drive a class from a delegate Pin
Pete O'Hanlon6-Jul-08 9:24
mvePete O'Hanlon6-Jul-08 9:24 

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.