I have a GUI app, that has a button added. Within several plugin dll's, a new button is created and needs to be added to the GUI in place of the existing one.
Is there a way to simply say ButtonA = ButtonB? Or do I have to remove the button from the GUI at runtime and then add the new one?
Thanks.
Or you can just link it to another handler, something like:
your old Click event handler
private void ButtonA_Click(object sender, EventArgs e)
{
//Do sth
}
your new Click Event handler (like if you create a new button)
private void ButtonB_Click(object sender, EventArgs e)
{
//Do sth
}
then you need to remove the first handler and add your new handler:
ButtonA.Click -= this.ButtonA_Click;
ButtonA.Click += new EventHandler(ButtonB_Click);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With