Using C++ Builder 10.2, VCL & VCL Styles...
I have a TPageControl
that has TFrames
on each of its TTabsheets
. One of these frames contains some TEdit
controls that show data read from a device. After the reading is acquired and the frame is updated, the system may create a screenshot of this frame and store it in a jpeg file.
Since the TTabsheet
in the TPageControl
with the TEdit
controls may not be visible when the jpeg is created, the jpeg may not have the text contents of the TEdit
controls painted. This has given me fits.
I have found that by using a TStaticText
that is styled, the text appears in the jpeg. This seems to be due to the fact that TStaticTextStyleHook.Paint
(in VCL.StdCtrls.pas
) draws the control itself rather than letting Windows do it.
There are two problems with using TStaticText
. Selecting the SystemStyle
choice (Windows) causes TStaticTextStyleHook.Paint
to skip painting the control itself and delegates to Windows (I think). Also, the appearance of TStaticText
isn't exactly what I want, but I may have to live with it.
Is Windows refusing to paint TEdit
control contents because the parent is not Visible
?
Is there a way to force Windows to paint the TEdit
controls in this situation?
UpdateWindow()
and RedrawWindow()
does not work.