I am attempting to handle an event when the Text changes in a
ToolStripComboB ox. I'm just not quite there yet, and hope you can help.
Here's what I have:
namespace Flash
{
class MyComboBox : ToolStripComboB ox
{
private MyComboBox()
{
// Code to initialize dropdown list
}
}
class RespondToChange
{
public void Update(object source, ToolStripItemEv entArgs e)
{
// My code
}
}
private void Form1_Load(obje ct sender, EventArgs e)
{
MyComboBox myComboBox = new MyComboBox();
RespondToChange doChange = new RespondToChange ();
// Note that I am relying on members in the inherited
ToolStripComboB ox to accomplish this
// I receive the following error: Cannot implicitly convert type
'System.Windows .Forms.ToolStri pItemEventHandl er' to 'System.EventHa ndler'
myComboBox.Text Update += new ToolStripItemEv entHandler(doCh ange.Update);
}
}
I have read everything I can find on event handlers, but they never seem to
deal with inherited classes, so I am a bit confused.
Thanks in advance.
ToolStripComboB ox. I'm just not quite there yet, and hope you can help.
Here's what I have:
namespace Flash
{
class MyComboBox : ToolStripComboB ox
{
private MyComboBox()
{
// Code to initialize dropdown list
}
}
class RespondToChange
{
public void Update(object source, ToolStripItemEv entArgs e)
{
// My code
}
}
private void Form1_Load(obje ct sender, EventArgs e)
{
MyComboBox myComboBox = new MyComboBox();
RespondToChange doChange = new RespondToChange ();
// Note that I am relying on members in the inherited
ToolStripComboB ox to accomplish this
// I receive the following error: Cannot implicitly convert type
'System.Windows .Forms.ToolStri pItemEventHandl er' to 'System.EventHa ndler'
myComboBox.Text Update += new ToolStripItemEv entHandler(doCh ange.Update);
}
}
I have read everything I can find on event handlers, but they never seem to
deal with inherited classes, so I am a bit confused.
Thanks in advance.
Comment