Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
QuestionCan I use local method in method Pin
Member 1115157117-Oct-14 20:57
Member 1115157117-Oct-14 20:57 
AnswerRe: Can I use local method in method Pin
OriginalGriff17-Oct-14 21:45
mveOriginalGriff17-Oct-14 21:45 
GeneralRe: Can I use local method in method Pin
Member 1115157117-Oct-14 21:54
Member 1115157117-Oct-14 21:54 
GeneralRe: Can I use local method in method Pin
OriginalGriff17-Oct-14 22:18
mveOriginalGriff17-Oct-14 22:18 
GeneralRe: Can I use local method in method Pin
Member 1115157117-Oct-14 22:43
Member 1115157117-Oct-14 22:43 
GeneralRe: Can I use local method in method Pin
OriginalGriff17-Oct-14 22:54
mveOriginalGriff17-Oct-14 22:54 
GeneralRe: Can I use local method in method Pin
Member 1115157117-Oct-14 23:42
Member 1115157117-Oct-14 23:42 
GeneralRe: Can I use local method in method Pin
OriginalGriff17-Oct-14 23:52
mveOriginalGriff17-Oct-14 23:52 
No!
An event handler is just a method with a specific signature: you can't create classes local to methods either. Just create the new class as private to the class containing the Click handler, and then create an instance of the class in the button_Click method. You can then call the inner class methods on that instance.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: Can I use local method in method Pin
Member 1115157118-Oct-14 0:06
Member 1115157118-Oct-14 0:06 
GeneralRe: Can I use local method in method Pin
OriginalGriff18-Oct-14 0:10
mveOriginalGriff18-Oct-14 0:10 
GeneralRe: Can I use local method in method Pin
Member 1115157118-Oct-14 0:15
Member 1115157118-Oct-14 0:15 
GeneralRe: Can I use local method in method Pin
OriginalGriff18-Oct-14 0:21
mveOriginalGriff18-Oct-14 0:21 
GeneralRe: Can I use local method in method Pin
BillWoodruff18-Oct-14 1:45
professionalBillWoodruff18-Oct-14 1:45 
GeneralRe: Can I use local method in method Pin
OriginalGriff18-Oct-14 1:55
mveOriginalGriff18-Oct-14 1:55 
AnswerRe: Can I use local method in method Pin
BillWoodruff17-Oct-14 22:31
professionalBillWoodruff17-Oct-14 22:31 
GeneralRe: Can I use local method in method Pin
Member 1115157117-Oct-14 22:43
Member 1115157117-Oct-14 22:43 
QuestionDeepCopy Not Working Pin
Kevin Marois17-Oct-14 8:28
professionalKevin Marois17-Oct-14 8:28 
AnswerRe: DeepCopy Not Working Pin
BillWoodruff17-Oct-14 8:42
professionalBillWoodruff17-Oct-14 8:42 
AnswerRe: DeepCopy Not Working Pin
Rob Philpott19-Oct-14 7:46
Rob Philpott19-Oct-14 7:46 
AnswerRe: DeepCopy Not Working Pin
Bernhard Hiller19-Oct-14 22:26
Bernhard Hiller19-Oct-14 22:26 
QuestionC# Socket Communication Pin
Lillepige17-Oct-14 8:17
Lillepige17-Oct-14 8:17 
AnswerRe: C# Socket Communication Pin
Richard Andrew x6417-Oct-14 9:49
professionalRichard Andrew x6417-Oct-14 9:49 
AnswerRe: C# Socket Communication Pin
Dave Kreskowiak17-Oct-14 9:52
mveDave Kreskowiak17-Oct-14 9:52 
AnswerRe: C# Socket Communication Pin
Eddy Vluggen17-Oct-14 10:49
professionalEddy Vluggen17-Oct-14 10:49 
AnswerRe: C# Socket Communication Pin
Cai Wallis-Jones18-Oct-14 1:40
Cai Wallis-Jones18-Oct-14 1:40 

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.