【问题标题】:How to Increase the size of a cell text in string grid of delphi?如何增加delphi字符串网格中单元格文本的大小?
【发布时间】:2014-03-10 04:38:35
【问题描述】:

我正在使用一个有五列的字符串网格,我想增加第三列的文本字体大小怎么做?

 while not SQLQuery.Eof do
  begin

    StringGrid1.Cells[0,rowCount] := SQLQuery.FieldByName('ELEMENTNAME').AsString ;
    StringGrid1.Cells[1,rowCount] := SQLQuery.FieldByName('ELEMENTTYPE').AsString ;
    StringGrid1.Cells[2,rowCount] := SQLQuery.FieldByName('ELEMENTSTRING').AsString ;
    StringGrid1.Cells[3,rowCount] := SQLQuery.FieldByName('BLOCKNAME').AsString ;
    StringGrid1.Cells[4,rowCount] := SQLQuery.FieldByName('ATTRIBUTES').AsString;

    rowCount := rowCount + 1;
    StringGrid1.RowCount := StringGrid1.RowCount + 1;
    SQLQuery.Next;
  end;

【问题讨论】:

    标签: delphi delphi-7 delphi-xe delphi-2009


    【解决方案1】:

    这是一个相当老的例子,但我怀疑没有太大变化http://www.delphipages.com/forum/showthread.php?t=142691

    【讨论】:

    • 感谢@Energ1ser 我得到了解决程序 TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);以 TStringGrid(Sender) 开头 if (ACol = 2) and (ARow 0 ) 然后开始 Canvas.Font.Size := 15; Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top + 2, Cells[ACol, ARow]);结尾;结尾;结束;
    猜你喜欢
    • 2011-10-05
    • 2019-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多