G
Guest
I am attempting to handle an event when the Text changes in a
ToolStripComboBox. I'm just not quite there yet, and hope you can help.
Here's what I have:
namespace Flash
{
class MyComboBox : ToolStripComboBox
{
private MyComboBox()
{
// Code to initialize dropdown list
}
}
class RespondToChange
{
public void Update(object source, ToolStripItemEventArgs e)
{
// My code
}
}
private void Form1_Load(object sender, EventArgs e)
{
MyComboBox myComboBox = new MyComboBox();
RespondToChange doChange = new RespondToChange();
// Note that I am relying on members in the inherited
ToolStripComboBox to accomplish this
// I receive the following error: Cannot implicitly convert type
'System.Windows.Forms.ToolStripItemEventHandler' to 'System.EventHandler'
myComboBox.TextUpdate += new ToolStripItemEventHandler(doChange.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.
ToolStripComboBox. I'm just not quite there yet, and hope you can help.
Here's what I have:
namespace Flash
{
class MyComboBox : ToolStripComboBox
{
private MyComboBox()
{
// Code to initialize dropdown list
}
}
class RespondToChange
{
public void Update(object source, ToolStripItemEventArgs e)
{
// My code
}
}
private void Form1_Load(object sender, EventArgs e)
{
MyComboBox myComboBox = new MyComboBox();
RespondToChange doChange = new RespondToChange();
// Note that I am relying on members in the inherited
ToolStripComboBox to accomplish this
// I receive the following error: Cannot implicitly convert type
'System.Windows.Forms.ToolStripItemEventHandler' to 'System.EventHandler'
myComboBox.TextUpdate += new ToolStripItemEventHandler(doChange.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.