Click here to Skip to main content
15,890,282 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: save my codes source Pin
MaulikDusara26-May-13 18:15
MaulikDusara26-May-13 18:15 
Questionvalidating on custom datagridview column Pin
sh-a19-May-13 23:56
sh-a19-May-13 23:56 
AnswerRe: validating on custom datagridview column Pin
sh-a22-May-13 4:27
sh-a22-May-13 4:27 
QuestionDialogBasics asin MFC. Pin
Bram van Kampen15-May-13 13:58
Bram van Kampen15-May-13 13:58 
AnswerRe: DialogBasics asin MFC. Pin
Richard MacCutchan15-May-13 22:10
mveRichard MacCutchan15-May-13 22:10 
GeneralRe: DialogBasics as in MFC. Pin
Bram van Kampen16-May-13 14:05
Bram van Kampen16-May-13 14:05 
GeneralRe: DialogBasics as in MFC. Pin
Richard MacCutchan16-May-13 21:07
mveRichard MacCutchan16-May-13 21:07 
GeneralRe: DialogBasics as in MFC. Pin
Bram van Kampen17-May-13 9:35
Bram van Kampen17-May-13 9:35 
I understand where the scope of an object starts and ends, I just do not know the names of the base class handlers which are (or should be) called when either the OK or Cancel button is clicked.

I used Dispose(), not because I did not understand scope, but, because it was the only method (I know it is the WRONG one) I could find that at least removed the window, and broke out of the modal loop.

I also want to find out how it is all wired up.

In de SDK we had the WindowProc, in MFC we have the MessageMap to tie events to handlers, what do we have in C#.NET? A Click on a Button event gets somewhere attached to the handler for that event. how and where?

An event handler can decide to terminate the modal loop and thereby return from ShowDialog. (how? what base method does it call to accomplish this). In other words, in MFC we have 'EndDialog' to get out of the modal loop. What do we have in C#.NET to do this?

Thanks for your time and interest,

Regards,
Smile | :)

Update- Stop Press,

Somewhere in Stackoverflow:

"but, I know that setting DialogResult closes the form! everyone knows that!".

Well, I did not know that! One of those surprises! It would take some gymnastics in MFC to do that! At the same time, I do not think that many MFC programmers would be happy about such development.

It is where thing are organised entirely differently than what an MFC programmer in his innocence would suspect. What also does not help that everything in C#.NET has an entirely different naming convention.

Anyway, I tried it.
C#
this.DialogResult = DialogResult.Cancel;

Closed the Dialog, and left it available for further interrogation.

The other queery stil stands. this.Hide()( called in the LogOn button handlers) hides the entire application, and not just the LogOn dialog. Is this a feature of the debug mode, or an error on my part.

Thanks again;
Smile | :) Smile | :)
Bram van Kampen


modified 17-May-13 19:27pm.

GeneralRe: DialogBasics as in MFC. Pin
Richard MacCutchan17-May-13 22:45
mveRichard MacCutchan17-May-13 22:45 
QuestionI suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
M-Badger15-May-13 11:43
M-Badger15-May-13 11:43 
AnswerRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
Eddy Vluggen16-May-13 5:01
professionalEddy Vluggen16-May-13 5:01 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
M-Badger16-May-13 8:34
M-Badger16-May-13 8:34 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
Eddy Vluggen16-May-13 9:13
professionalEddy Vluggen16-May-13 9:13 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
M-Badger16-May-13 9:57
M-Badger16-May-13 9:57 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
Eddy Vluggen16-May-13 11:25
professionalEddy Vluggen16-May-13 11:25 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
M-Badger16-May-13 9:58
M-Badger16-May-13 9:58 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
Eddy Vluggen16-May-13 11:26
professionalEddy Vluggen16-May-13 11:26 
AnswerRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
jschell16-May-13 7:57
jschell16-May-13 7:57 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
M-Badger16-May-13 8:37
M-Badger16-May-13 8:37 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
jschell17-May-13 10:13
jschell17-May-13 10:13 
AnswerRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
TnTinMn16-May-13 13:37
TnTinMn16-May-13 13:37 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
M-Badger17-May-13 6:49
M-Badger17-May-13 6:49 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
TnTinMn17-May-13 8:33
TnTinMn17-May-13 8:33 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
M-Badger17-May-13 21:47
M-Badger17-May-13 21:47 
QuestionAssembly Loading Pin
#realJSOP14-May-13 5:10
mve#realJSOP14-May-13 5:10 

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.