In Delphi 2006, I am showing a modal form. User input in that form can change data that might be displayed currently on the parent form which is the mainform. To reflect those changes I need to force a repaint of some ownerdrawn components on the mainform. I tried to do that like this from the modal form:
MainForm := Application.MainForm;
MainForm.Invalidate;
MainForm.Update;
That did not change a bit. I always thought an "update" on the form would always repaint it right away - apparently not so. The painting code itself should be ok since I can move the modal form over those ownerdraw components to force a manual repaint.
But how can I force the repaint programmatically when the data changes?
Edit: I will try Application.ProcessMessages and Refresh next week, thanks for the suggestions.
Sorry for taking so long to answer and thanks to all who responded. Calling Refresh() was part of the solution but it had to be done on the custom draw components, not on the form they were on... Now I would like to accept more than one answer ;-)