Convert nb.FormClosed += (s, ex) => to C++ CLI
I want to convert this
nb.FormClosed += (s, ex) =>
(overriding OnClose form method)
to C++ CLI. I was trying something like .override but can't fi开发者_运维技巧nd correct C++CLI variant of it.
That doesn't override OnClose. That adds an event listener to the FormClosed event.
C++/CLI doesn't support lambda expressions. You'll need to subscribe with a real method. You'll also need to initialize the delegate instance explicitly. Here's the basic syntax:
nb->FormClosed += gcnew FormClosedEventHandler(this, &ClassName::MyCloseHandler)
精彩评论