就象开始菜单中的“windows ......professional”的写法

解决方案 »

  1.   

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    procedure TForm_Main.Button7Click(Sender: TObject);
    var exForm: TForm;
        exImage: TImage;
        StrList: TStringList;
    var i, Edge, CharWidth, RowSpace: integer;
        Rect: TRect;
        TextFormat: UINT;
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      function MaxLength: integer;
      var i: integer;
      begin
        Result := 0;
        for i:=1 to StrList.Count do if Length(StrList.Strings[i-1])>Result then Result := Length(StrList.Strings[i-1]);
      end;
    begin
      Edge := 5;
      StrList := TStringList.Create;
      StrList.Clear;
      if MessageBox(Self.Handle,PChar('请选择显示信息类别!'),'提示!',MB_YESNO+MB_ICONQUESTION)=IDYes
      then begin
             //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             TextFormat := DT_VCENTER;
             StrList.Add('岱宗夫如何'); StrList.Add('齐鲁青未了'); StrList.Add('造化钟神秀'); StrList.Add('阴阳割昏晓');
             StrList.Add('荡胸生层云'); StrList.Add('绝眦入归鸟'); StrList.Add('会当凌绝顶'); StrList.Add('一览众山小');
           end
      else begin
             //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             TextFormat := DT_TOP;
             StrList.Add('念奴娇');       StrList.Add('赤壁怀古');     StrList.Add('大江东去');     StrList.Add('浪淘尽');
             StrList.Add('千古风流人物'); StrList.Add('故垒西边');     StrList.Add('人道是');       StrList.Add('三国周郎赤壁');
             StrList.Add('乱石穿空');     StrList.Add('惊涛拍岸');     StrList.Add('卷起千堆雪');   StrList.Add('江山如画');
             StrList.Add('一时多少豪杰'); StrList.Add('遥想公谨当年'); StrList.Add('小乔初嫁了');   StrList.Add('雄姿英发');
             StrList.Add('羽扇纶巾');     StrList.Add('谈笑间');       StrList.Add('强虏灰飞烟灭'); StrList.Add('故国神游');
             StrList.Add('多情应笑我');   StrList.Add('早生华发');     StrList.Add('人生如梦');     StrList.Add('一樽还酹江月');
           end;
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Application.CreateForm(TForm, exForm);
      try
        RowSpace := 5;
        CharWidth := Abs(exForm.Font.Height)+4;
        exImage := TImage.Create(exForm);
        exImage.Parent := exForm;
        exImage.Height := MaxLength*Abs(exForm.Font.Height);
        exImage.Width := (CharWidth+RowSpace)*(StrList.Count + 1);
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Rect := Bounds(Edge, Edge, exImage.Width-Edge*2, exImage.Height-Edge*2);
        exImage.Canvas.Rectangle(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom);
        for i:=1 to StrList.Count do
        begin
          Rect := Bounds(exImage.Width-(CharWidth+RowSpace)*i-Edge*2, Edge+(exImage.Height-Edge*2-exImage.Canvas.TextWidth(StrList.Strings[i-1])) div 2, CharWidth, exImage.Height-Edge*2);
          DrawText(exImage.Canvas.Handle,PChar(StrList.Strings[i-1]),Length(StrList.Strings[i-1]),Rect,DT_CENTER or TextFormat or DT_WORDBREAK);
        end;
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        exForm.Position := poScreenCenter;
        exForm.BorderStyle := bsDialog;
        exForm.ClientWidth := exImage.Width;
        exForm.ClientHeight := exImage.Height;
        exForm.ShowModal;
      finally
        exForm.DestroyComponents;
        exForm.Free;
      end;
    end;
      

  2.   

    你可以写在Image上,然后旋转90度
      

  3.   

    太麻烦了  有没有简单点的办法啊?? 我想问怎么让quick中的tdbedit.text控件中文字分两行显示啊?