I need to retrieve the TextChanged
event of the ToolStripTextBox
with a delay, to do some stuff after x seconds of stop keypressing..
I found this (and works) example for the TextBox
.
https://www.codeproject.com/Articles/20068/Custom-TextBox-that-Delays-the-TextChanged-Event
I tried to convert it for the ToolStripTextBox
, but I got this error:
void DelayTimer_Elapsed(object sender, ElapsedEventArgs e)
{
// stop timer.
DelayTimer.Enabled = false;
// set timer elapsed to true, so the OnTextChange knows to fire
TimerElapsed = true;
try
{
// use invoke to get back on the UI thread.
this.Invoke(new DelayOverHandler(DelayOver), null);
}
catch { }
}
'DelayToolStripTextBox' does not contain a definition for 'Invoke' and no extension method 'Invoke' accepting a first argument of type 'DelayToolStripTextBox' could be found (are you missing a using directive or an assembly reference?)
the ToolStripTextBox
doesn't have the 'Invoke` method..
does anybody can help me?
thanks in advance