I noticed that the C++ Builder ActionTestTabs demo has a splitter between the TSRVPageScroll and the main TSRichViewEdit. The user should be able to use this splitter to allow more or less room for the TSRVPageScroll, but the TSRVPageScroll pages do not change size as the user moves the splitter.
You can handle the OnMoved event for the splitter with something like:
SRVPageScroll1->PageWidth = SRVPageScroll1->Width * 0.85;
That works to change the page size, but the TSRVPageScroll does not update to show the pages in the new size until the user clicks either the TSRVPageScroll or the TSRichViewEdit, which triggers some sort of update, and the pages get redrawn in the new, changed size.
I have tried multiple ways to try to get the TSRVPageScroll to automatically update after the page size is changed, including Repaint(), Invalidate(), Update() and Refresh(), on both the TSRVPageScroll and the TSRichViewEdit, but have not been able to get this to update.
Can you tell me the best way to get the TSRVPageScroll to update after changing its PageWidth?
Thank you.
Handling OnMoved event for splitter to resize TSRVPageScroll
Fixed:
Code: Select all
procedure TSRVPageScroll.SetPageWidth(Value : Integer);
begin
if FPageWidth <> Value then
begin
FPageWidth := Value;
UpdateCache; // <<<<<<<<<<<< ADDING
Invalidate;
end;
end;
That fixed it
Thank you!