【问题标题】:How simple to rotate text in stringgrid in delphi?在delphi的stringgrid中旋转文本有多简单?
【发布时间】:2012-03-07 02:44:11
【问题描述】:

在 stringgrid 中旋转文本的简单方法(90 度和 45 度)?或者是否有像 TStringGrid 这样的免费组件,在单元格中有文本旋转?

【问题讨论】:

  • 参见SwissDelphiCenter 的示例(由 Reinhard Schatzl 撰写)如何通过 90 度旋转来执行此操作。
  • This Lazarus answer 在帖子底部显示了 Delphi 解决方案。
  • 不旋转图像,绘制旋转的文字

标签: delphi rotation tstringgrid


【解决方案1】:

您可以使用ZColorStringGrid 组件(免费)。组件具有每个单元格的附加属性(文本旋转、缩进、颜色、对齐)。支持多行文字(并且可以旋转多行文字)和合并单元格。

代码示例:

  ZColorStringGrid1.CellStyle[0, 1].Font.Name := 'Tahoma';
  ZColorStringGrid1.CellStyle[0, 1].Font.Size := 12;
  ZColorStringGrid1.CellStyle[0, 1].Rotate := 90;
  ZColorStringGrid1.Cells[0, 1] := 'Rotate' + sLineBreak + 'text' + sLineBreak + '90 degrees';

【讨论】:

    猜你喜欢
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多