I\'ve created a user control with some buttons. When you click a button in the UserControl the BackColor of the button changes:
private void button1(object send
In your UserControl
make event handler ColorChanged
and fire that event when color changes. In your form add listener and appropriate code when event fires.
So, in your control, make EventHandler
, like this
public partial class UserControl1 : UserControl
{
public EventHandler ColorChanged;
then, fire event on your button click, like this:
private void button1(object sender, EventArgs e)
{
ColorChanged?.Invoke(sender, e);
//rest of your code...
}
in your form, add listener:
userControl.ColorChanged += new EventHandler(UserControl_ColorChanged)
and add method that will be executed and enable button...
private void UserControl_ColorChanged(object sender, EventArgs e)
{
//enable button here
}