如题!!!
  label的中心点固定,当给label的caption赋值时,label会自动往两旁伸展,而不会单一的往左,或往右伸展!
  我试过Alignment的taCenter属性,但好像没用!是不是还有什么地方没设置过?

解决方案 »

  1.   

    我试过了,
    Alignment.taLeftJustify是自动往左伸展啊
    Alignment.taRightJustify自动向右伸展
      

  2.   

    怎么会没用?
    就是alignment属性的tacenter
    完全附合你的要求
      

  3.   

    autosize设置为false
    alignment属性为center,注意是要先改变属性再输入文字
      

  4.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      if Label1.Alignment in [taCenter] then
        Label1.AutoSize := False;
    end;
      

  5.   

    嘿嘿,
    Aligment 设为taCenter
      

  6.   

    将Aligment 设为taCenter就可以了!但只能位于首尾居中但不能整体居中再将Autosize=false就可以了
      

  7.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      if Label1.Alignment in [taCenter] then
        Label1.AutoSize := False;
    end;