check if there is a delay between two keypress in textbox

I have a textbox that depending on the user's input, we run preview for this values. But we don't want to do after every text. What I mean is how can we delay execution of preview, but the user still can continue typing. IF there is a delay between two keystrokes, I will do preview. I hope somebody can help me.

If you are using a WinForm App, you can use a timer and the textBox Text Change Function, and on every key press reset the timer. If the timer reaches the delayed time, update the text.
Thanks a lot I will try and let you know about the result.

This is what I did and works perfectly, I just need to play with interval to find the perfect timing.

void __fastcall TLineCornerForm::FilletRadEditKeyPress(TObject *Sender,
char &Key)
{
TimerSetCapture->Enabled = false;
}
//---------------------------------------------------------------------------


void __fastcall TLineCornerForm::FilletRadEditChange(TObject *Sender)
{
// Show preview automatically in workspace

TimerSetCapture->Enabled = true;
TimerSetCapture->Interval = 1000;

}
//---------------------------------------------------------------------------

void __fastcall TLineCornerForm::TimerSetCaptureTimer(TObject *Sender)
{
TimerSetCapture->Enabled = false;
ExecuteDelayedProc();

}
Topic archived. No new replies allowed.