【问题标题】:Consume windows form events in C++/CLI在 C++/CLI 中使用 windows 窗体事件
【发布时间】:2010-03-15 05:14:40
【问题描述】:

如何将事件处理程序方法添加到 TextBox 的 TextChanged 事件?

【问题讨论】:

    标签: winforms events event-handling c++-cli


    【解决方案1】:

    例子:

    void SomeClass::TextChanged_Handler(Object ^sender, EventArgs ^e){
        System::Diagnostics::Debug::WriteLine(L"Text changed.");
    }
    
    void SomeClass::RegisterHandler(){
        textBox->TextChanged += gcnew EventHandler(this, &SomeClass::TextChanged_Handler);
    }
    

    在 MSDN 上查看 EventArgs class 的示例。

    【讨论】:

      【解决方案2】:
      猜你喜欢
      • 2017-06-15
      • 1970-01-01
      • 2021-09-11
      • 1970-01-01
      • 1970-01-01
      • 2016-09-22
      • 2013-03-09
      • 2013-02-13
      • 1970-01-01
      相关资源
      最近更新 更多