Click here to Skip to main content
15,904,287 members
Home / Discussions / C#
   

C#

 
GeneralRe: win6x_registry_tweak Pin
Dave Kreskowiak24-Oct-17 2:56
mveDave Kreskowiak24-Oct-17 2:56 
GeneralRe: win6x_registry_tweak Pin
Pete O'Hanlon23-Oct-17 9:49
mvePete O'Hanlon23-Oct-17 9:49 
QuestionNewbie question - how to access this object Pin
Member 1347915022-Oct-17 13:10
Member 1347915022-Oct-17 13:10 
AnswerRe: Newbie question - how to access this object Pin
User 740747022-Oct-17 14:23
User 740747022-Oct-17 14:23 
AnswerRe: Newbie question - how to access this object Pin
OriginalGriff22-Oct-17 19:50
mveOriginalGriff22-Oct-17 19:50 
AnswerRe: Newbie question - how to access this object Pin
BillWoodruff23-Oct-17 4:48
professionalBillWoodruff23-Oct-17 4:48 
GeneralMessage Closed Pin
23-Oct-17 5:51
User 740747023-Oct-17 5:51 
GeneralRe: Newbie question - how to access this object Pin
BillWoodruff24-Oct-17 3:46
professionalBillWoodruff24-Oct-17 3:46 
Peter Vegter wrote:
Is there a reason you don't just subscribe to the 'original' event (MouseDown)?
Hi Peter, a very good question to ask.

I can't speak for OG's intent, but, note that in my code example the only thing that the sub-classed PictureBox exposes to the "outside" is a property of Type 'Action. In OG's code the MouseDown event handler is public, and the 'event delegate is public. Is that a significant difference: I'm not sure.

My code injects a reference to executable code (a "callback," if you will) into the sub-classed PictureBox: imho, that achieves minimal dependency. I believe "injection," and use of 'Action, and 'Func, are useful in educating C# students in a way that moves them toward the kind of thinking that, hopefully, will help them get to SOLID; my experience teaching this usage has reinforced that conviction.

Some students have a very difficult time grokking C#/,NET's Delegate/EventHandler syntax where you first have to create a Type declaration, the Delegate, then create an instance of that Type, then create an On-EventHandler/Event with its required null-check.

I welcome your feedback.

cheers, Bill
«While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it. A few hundred years later another traveler despairing as myself, may mourn the disappearance of what I may have seen, but failed to see.» Claude Levi-Strauss (Tristes Tropiques, 1955)

GeneralMessage Closed Pin
24-Oct-17 12:56
User 740747024-Oct-17 12:56 
GeneralRe: Newbie question - how to access this object Pin
Jim_Snyder27-Oct-17 4:56
professionalJim_Snyder27-Oct-17 4:56 
QuestionAnyone experiencing that, .NET Standard project in VS2017 hanging while compiling Pin
Super Lloyd22-Oct-17 9:42
Super Lloyd22-Oct-17 9:42 
AnswerRe: Anyone experiencing that, .NET Standard project in VS2017 hanging while compiling Pin
Richard MacCutchan22-Oct-17 11:20
mveRichard MacCutchan22-Oct-17 11:20 
QuestionRe: Anyone experiencing that, .NET Standard project in VS2017 hanging while compiling Pin
Super Lloyd22-Oct-17 12:28
Super Lloyd22-Oct-17 12:28 
AnswerRe: Anyone experiencing that, .NET Standard project in VS2017 hanging while compiling Pin
Richard MacCutchan22-Oct-17 20:52
mveRichard MacCutchan22-Oct-17 20:52 
AnswerRe: Anyone experiencing that, .NET Standard project in VS2017 hanging while compiling Pin
jschell23-Oct-17 7:34
jschell23-Oct-17 7:34 
QuestionHow to start a form without being activated? [solved] Pin
alin120-Oct-17 14:48
alin120-Oct-17 14:48 
AnswerRe: How to start a form without being activated? Pin
BillWoodruff20-Oct-17 16:30
professionalBillWoodruff20-Oct-17 16:30 
AnswerRe: How to start a form without being activated? Pin
OriginalGriff21-Oct-17 0:03
mveOriginalGriff21-Oct-17 0:03 
GeneralRe: How to start a form without being activated? Pin
BillWoodruff21-Oct-17 0:27
professionalBillWoodruff21-Oct-17 0:27 
GeneralRe: How to start a form without being activated? Pin
OriginalGriff21-Oct-17 0:41
mveOriginalGriff21-Oct-17 0:41 
GeneralRe: How to start a form without being activated? Pin
alin121-Oct-17 7:04
alin121-Oct-17 7:04 
GeneralRe: How to start a form without being activated? Pin
alin121-Oct-17 7:00
alin121-Oct-17 7:00 
AnswerRe: How to start a form without being activated? Pin
Sascha Lefèvre21-Oct-17 7:20
professionalSascha Lefèvre21-Oct-17 7:20 
GeneralRe: How to start a form without being activated? Pin
alin121-Oct-17 11:40
alin121-Oct-17 11:40 
GeneralRe: How to start a form without being activated? Pin
Sascha Lefèvre21-Oct-17 12:28
professionalSascha Lefèvre21-Oct-17 12:28 

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.