How to copy or duplicate other controls events? I want to use other controls event in a new controls. Lets say i have a textboxes.
TextBox tbTemp = new TextBox ();
tbTemp.Keypress += new KeyPressEventHandler(some keypress); //I assigned some keypress event here & this works fine
TextBox tbNew = new TextBox ();//create new textbox and assign keypress events from existing textbox
tbNew.Keypress += tbTemp.Keypress; //This is not working. It says the event control.keypress can only appear on left hand side of +=
or
tbNew.Keypress += new KeyPressEventHandler(tbTemp.Keypress);//this is not working
Is there a way to capture other controls events? I need to capture or duplicate the tbTemp keypressEvent and assigned to new TextBox(tbNew)