zoukankan      html  css  js  c++  java
  • Delphi RichEdit操作

      1.选择设置对齐

    RichEdit1.SelectAll;
    RichEdit1.Paragraph.Alignment:=taLeftJustify; // switch for other alignments
    RichEdit1.SelLength:=0;

    2.设置对齐和内容

    redt1.Clear;

    redt1.Lines.Add('XXXX分析报告' + #13#10);
    strMsg := '打印时间:' + FormatDateTime('yyyy年hh月dd日 hh时MM分ss秒', Now);
    redt1.Lines.Add(strMsg);
    strMsg := '打印时间:' + FormatDateTime('yyyy年hh月dd日 hh时MM分ss秒', Now);
    redt1.Lines.Add(strMsg);
    strMsg := '进样时间:' + FormatDateTime('yyyy年hh月dd日 hh时MM分ss秒', Now);
    redt1.Lines.Add(strMsg);
    strMsg := '质检(E)字第()号';
    redt1.Lines.Add(strMsg);
    strMsg := '送样单位:' + 'XXX公司' + '仪器型号:' + 'SC-1001-09A';
    redt1.Lines.Add(strMsg);
    strMsg := '取样日期:' + FormatDateTime('yyyy年hh月dd日 ', Now) + '收样日期:' + FormatDateTime('yyyy年hh月dd日 ', Now);
    redt1.Lines.Add(strMsg);
    strMsg := '样品批号:' + '' + '样品名称:' + '固液';
    redt1.Lines.Add(strMsg);
    strMsg := '样品罐号:' + 'A-1-2';
    redt1.Lines.Add(strMsg);
    strMsg := '仪器文件控制参数:' + '#1111';
    redt1.Lines.Add(strMsg);
    strMsg := '';
    redt1.Lines.Add(strMsg);
    strMsg := 'C:AAAAAAA111.bmp';
    redt1.Lines.Add(strMsg);
    redt1.SelStart := 4;
    redt1.Paragraph.Alignment := taCenter;

    3.改变字体大小

    //改变第二行的字体大小为15
    RichEdit1.SelStart := Length(RichEdit1.Lines[0]);
    RichEdit1.SelLength := Length(RichEdit1.Lines[1]) + 2;
    richedit1.SelAttributes.Size := 15;

  • 相关阅读:
    mysql高级之编程优化
    高性能产品必由之路
    linux下安装xhprof
    linux下安装apc
    linux下安装vld
    python装饰器通俗易懂的解释!
    python函数基础 与文件操作
    python基础入门一(语法基础)
    iOS Keychain,SSKeychain,使用 理解 原理
    起头
  • 原文地址:https://www.cnblogs.com/zhangzhifeng/p/5254050.html
Copyright © 2011-2022 走看看