我使用代码
procedure TMyCanvas.RichEditChange(Sender: TObject);
var
ScrollInfo: TScrollInfo;
begin
FillChar(ScrollInfo, SizeOF(ScrollInfo), 0);
ScrollInfo.cbSize := SizeOf(ScrollInfo);
ScrollInfo.fMask := SIF_RANGE or SIF_PAGE or SIF_POS;
if GetScrollInfo(FRichEdit.Handle, SB_VERT, ScrollInfo) then
begin
FVertScroll.Max := ScrollInfo.nMax;
FVertScroll.Min := ScrollInfo.nMin;
FVertScroll.PageSize := ScrollInfo.nPage;
FVertScroll.Position := ScrollInfo.nPos;
end;
Invalidate;
end;
问题是,当我添加/删除行时,它会在我调整表单大小时给出错误。它说“滚动条属性超出范围”
我该怎样避免它?
感谢名单