【发布时间】:2015-04-18 10:15:08
【问题描述】:
如何在 Delphi 中制作这样的东西:
我知道我可以从 3 个表格中制作它,这样会更容易,但我怎样才能让表格单元格拆分和合并以及如何让文本旋转 90 度?
是否有一些内置拆分和合并的好内容库?
【问题讨论】:
标签: delphi delphi-2007
如何在 Delphi 中制作这样的东西:
我知道我可以从 3 个表格中制作它,这样会更容易,但我怎样才能让表格单元格拆分和合并以及如何让文本旋转 90 度?
是否有一些内置拆分和合并的好内容库?
【问题讨论】:
标签: delphi delphi-2007
查看woll2woll 或infopower。他们肯定会做网格。字体可以通过覆盖OnDrawDataCell、OnDrawGroupHeaderCell和OnDrawTitleCell事件并使用旋转字体编写文本来实现。
{****************************************************************
* 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;
【讨论】: