DELPHI表格细胞分裂&合并

时间:2015-04-18 10:15:09

标签: delphi delphi-2007

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

Table

我知道我可以从3张桌子上制作它,因此它会更容易,但我怎样才能让桌面细胞分裂和放大合并以及如何让文本转90deg。?

是否有一些好的内容库可以分割和分割合并内置?

1 个答案:

答案 0 :(得分:1)

结帐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;