How do I add an event handler method to, say a TextBox's TextChanged event ?
+2
A:
Example:
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);
}
See examples for EventArgs class on MSDN.
Vulcan Eager
2010-03-15 05:33:36