[Q] SetWindowText on Edit Boxes...
-
Hello, Setting the edit box text via SetWindowText does not work inmediatelly if you set it from one of the handlers of your dialog. Instead, the update will happen only after the handler ends its run.
void CDemoDlg::OnNewBnClicked()
{GetDlgItem(IDC\_EDIT)->SetWindowText("New"); // Some code that takes few msec to end
}
If I replace the Edit Control with a static control, the text is updated inmediatelly. I guess that the answer is the use of SendMessage and PostMessage. Is there a way to update an edit control inmediatelly and not wait till the handler ends? If you want to display for example the results when the user moves a slidebar, the edit control will not be updated until the cursor stops. Any hint? (I need an edit control there :(
-- **Ricky Marek** (_AKA: rbid_)
-- "Things are only impossible until they are not" --- Jean-Luc Picard My articles -
Hello, Setting the edit box text via SetWindowText does not work inmediatelly if you set it from one of the handlers of your dialog. Instead, the update will happen only after the handler ends its run.
void CDemoDlg::OnNewBnClicked()
{GetDlgItem(IDC\_EDIT)->SetWindowText("New"); // Some code that takes few msec to end
}
If I replace the Edit Control with a static control, the text is updated inmediatelly. I guess that the answer is the use of SendMessage and PostMessage. Is there a way to update an edit control inmediatelly and not wait till the handler ends? If you want to display for example the results when the user moves a slidebar, the edit control will not be updated until the cursor stops. Any hint? (I need an edit control there :(
-- **Ricky Marek** (_AKA: rbid_)
-- "Things are only impossible until they are not" --- Jean-Luc Picard My articleshave you tried calling
UpdateWindow()
? My articles www.stillwaterexpress.com BlackDice