how do i remove a MouseEventHandler [modified]
-
hi all stuckt agein hope i not highjack this hole topic :wtf:
void Disp::Lock_Down(System::Object ^o, System::Windows::Forms::MouseEventArgs ^e){ Lock->MouseMove += gcnew System::Windows::Forms::MouseEventHandler( this, &Disp::Lock_Drag ); MousePosition=MainF->MousePosition; } void Disp::Lock_Up(System::Object ^o, System::Windows::Forms::MouseEventArgs ^e){ >>>>>>>>>>>>>> not like this but how ??? :confused: Lock->MouseMove->Remove(this, &Disp::Lock_Drag); <<<<<<<<<<<<<< }
-- modified at 9:48 Friday 25th May, 2007 this worksvoid Disp::Lock_Down(System::Object ^o, System::Windows::Forms::MouseEventArgs ^e){ t = gcnew System::Windows::Forms::MouseEventHandler( this, &Disp::Lock_Drag ); Lock->MouseMove += t; MousePosition=MainF->MousePosition; } void Disp::Lock_Up(System::Object ^o, System::Windows::Forms::MouseEventArgs ^e){ Lock->MouseMove -= t; }
BUT i realy not like "t" is there a way to get it somehow else mayby out of Object ^o or MouseEventArgs ^e or how ever whit out the need to store it by my self