DELPHI Table 单元格拆分和合并

DELPHI Table cell split & merge

如何在 Delphi 中制作这样的东西:

我知道我可以从 3 个表格中制作它,这样会更容易,但是我如何使 Table 单元格拆分和合并以及如何使文本旋转 90 度。?

是否有一些好的内容库内置了拆分和合并功能?

查看 woll2wollinfopower。他们肯定会做网格。字体可以通过覆盖 OnDrawDataCellOnDrawGroupHeaderCellOnDrawTitleCell 事件并使用旋转字体写入文本来实现。

{****************************************************************
* Create angled font. Procedure writen by Keith Wood            *
****************************************************************}
procedure CreateAngledFont (AFont : TFont; const AAngle : Integer);
var
  FntLogRec: TLogFont { Storage area for font information } ;
begin
  { Get the current font information. We only want to modify the angle }
  fillchar (FntLogRec, sizeof(FntLogRec), #0);
  GetObject (AFont.Handle, SizeOf(FntLogRec), Addr(FntLogRec));

  { Modify the angle. "The angle, in tenths of a degrees, between the   base
    line of a character and the x-axis." (Windows API Help file.) }
  FntLogRec.lfEscapement   := (AAngle * 10);
  FntLogRec.lfOrientation  := (AAngle * 10);
  FntLogRec.lfOutPrecision := OUT_TT_PRECIS;  { Request TrueType precision }

  { Delphi will handle the deallocation of the old font handle }
  AFont.Handle := CreateFontIndirect (FntLogRec);
end;