开发者

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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜