又发现源码中的一个小错误。那个组件安装后 能正常编译。但是,如果随便编辑一下,然后编译,IDE会提示错误。const Dots: TCharSet = [' ', '!', '?', '%', '-', '(', ')', '[', ']', '{', '}', '?, '?];主要是这个集合最后的项目有问题。 '?, '?];这样肯定不符合语法,不知道应该修改为怎么样?看样子,'?'前面已经有了,不知道作者本来想的是什么。function GetTextHeight(Dlg, Font: THandle; const Text: AnsiString; TextWidth: Integer): Integer;const Dots: TCharSet = [' ', '!', '?', '%', '-', '(', ')', '[', ']', '{', '}', '?, '?];var Size: TSize; DC: HDC; n, i, j: Integer; List, Words: TStringList; Width: Integer;begin Result := 0; Dec(TextWidth, 6); // Decreases of the control borders size. List := TStringList.Create; Words := TStringList.Create; DC := GetDC(Dlg); SelectObject(DC, Font); try List.Text := Text; for n := 0 to (List.Count - 1) do begin if (List[n] = '') then List[n] := ' '; Words.Clear; ExtractList(List[n], Words, Dots, False, True); Width := 0; for i := 0 to (Words.Count - 1) do begin // Get the current work sizes (width/height). GetTextExtentPoint32(DC, PChar(Words), Length(Words), Size); if (Width = 0) then Inc(Result, Size.cy); Inc(Width, Size.cx); for j := 1 to (Width div TextWidth) do begin Inc(Result, Size.cy); Width := Size.cx; end; end; end; finally ReleaseDC(Dlg, DC); Words.Free; List.Free; end;end;