Dialog box redraw
I think this is a fairly simple question, thus i'm not posting any code.
My problem is as follows - I have a simple dialog box, with a static control that is holding text. I then have the text change, as events happen (like, for example, when a certain app starts, or when certain menus are chosen). The problem is, it does not redraw the text until I pass my cursor over the box, or otherwise bring focus to it.
How can I force it to draw the text as soon as its changed? I assume its just a matter of forcing it to redraw.
Any advice is very much appreciated :)
I don't know what compiler you use but if it is VC and MFC you can call UpdateData(TRUE) or UpdateData(FALSE) to either read or write variables to your dialog. So if you catch the OnChange message and add the line UpdateData(False) that will write your varibles back to your dialog
sorry, forgot to add compiler info
Borland C++Builder 5 Pro
only WinAPI please, not using MFC.
use the handle to your static text control to call InvalidateRect()
then call UpdateWindow() with it.
Thanks for the suggestion Stoned, but that doesn't seem to be working :(
No errors, just doesn't change anything.
Nevermind, it worked.. I was just being stupid, got my handlers mixed up with InvalidateRect.