问题是这样的:
    有一段时间,我的Delphi6中大多数控件的String类型的属性都具有多行编辑的功能(可能安装了什么东西),很方便,可不知什么时候又没了(Delphi6重新安装过)。比如,Label的Caption属性,一般可视控件的Hint属性等,它们在属性编辑器里除了可以直接输入字符串值以外,右边还有“...”,点击可以打开一个多行编辑窗口,就象Memo的Lines属性一样。不知道是怎么有的,又不知怎么没了。
    我想,可能是需要安装了什么设计期包吧!不知道大家明白我的意思没有?
    请高手指点。

解决方案 »

  1.   

    wordwarp属性设置为 TRUE,
    autosize  := false;就OK了
      

  2.   

    谢谢楼上的,不过不是这个意思。
        我指的是在属性编辑器里边在输入Caption或Hint属性时,本来就有一个可以输入多行字符串的功能。可以直接输入多行的文本,就象Memo的Lines属性一样,点击"..."就会弹出一个StringsEditor。
      

  3.   

    在程序中写:
    label.caption:='aaa'+#13#10+'bbb';
      

  4.   

    原先你肯定装了某个属性编辑器,这个属性编辑器继承了TStringPropertyEditor,使你能够在编辑字符串类型的属性时能够弹出一个对话框,这个对话框里包含一个TMemo控件,使你能够进行多行编辑。你可以亲自做一个属性编辑器:弹出一个窗口进行多行编辑。在注册这个属性编辑器时,覆盖原来的属性编辑器,可以这样注册:
    RegisterPropertyEditor(TypeInfo(TString), TWinControl, '', TMyPropertyEditor);
      

  5.   

    明确一下:我指的不是用代码实现多行,也不是修改某些属性来实现多行,而是它本来就可以直接输入多行。[经历1]为了模仿显示一个多行Label(不能编辑,不能是无效灰色),所以,就使用一个Enabled=False的Panel和一个Memo来实现,很不爽![经历2]有一次,不知发生了什么事情以后,我的Label控件可以输入多行文本了。可以直接输入正常的单行文本,同时,点击右边的"...",就出现一个"String List Editor",随意输入,很爽!就连所有可视控件的Hint属性也是如此,让人感到可爱极了!我想可能是安装了什么控件或者别的什么东西,不太清楚,但好像装了。[经历3]又有一次,可能重装了Delphi6,也可能重装了Win2000prof,甚至分区了。这时,却发现美好的东西都没有了:Label的Caption、控件的Hint都没有了"...",伤心呀!于是,就又回到了经历1。开始重新接受Panel+Memo的伤痕,甚至修改文本方式的Form文件。    她走了,这真象是一场梦。我想重新找回失去的东西,请大家帮忙。
      

  6.   

    你难得不是想在设计期编辑Label的Caption属性时,点击“...”按钮弹出窗口可进行多行编辑吗?
      

  7.   

    wanggongqin(功勤)好像明白了我的意思。
      

  8.   

    回复wanggongqin(功勤):是的。不过,我不乐于去编写并注册属性编辑器。
      

  9.   

    估计你安装了Rx控件包?另外你可以写一个简单的Pas,Register Caption属性的属性编辑器是TStrings的编辑器即可。
    另外你也可以安装下面的Pas单元到你的dclusr中即可:
    unit StrEditor;interfaceuses Windows,Classes, Controls, StdCtrls,Buttons, TypInfo,Forms,ExtCtrls,
        {$IFDEF VER140}DesignIntf, VCLEditors {$ELSE} DsgnIntf{$ENDIF};type
      TStrEditDlg = class(TForm)
        Memo: TMemo;
        BtnOK: TBitBtn;
        BtnCancel: TBitBtn;
        Bevel1: TBevel;
        BtnAbout: TBitBtn;
        Label1: TLabel;
        procedure BtnAboutClick(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
        procedure CreateParams(var Param:TCreateParams);override;
      end;type
      TCaptionEditor = class(TCaptionProperty)
      public
        function GetAttributes: TPropertyAttributes; override;
        procedure Edit; override;
      end;procedure Register;implementation{$R *.DFM}procedure Register;
    begin
      RegisterPropertyEditor(TypeInfo(TCaption), TObject, 'Caption', TCaptionEditor);
      RegisterPropertyEditor(TypeInfo(TCaption), TObject, 'Text', TCaptionEditor);
      RegisterPropertyEditor(TypeInfo(string), TObject, 'Hint', TCaptionEditor);
    end; { Register }{ THintProperty }procedure TCaptionEditor.Edit;
    var
      Comp              : TPersistent;
    begin
      with TStrEditDlg.Create(Application) do
      try
        Comp := GetComponent(0);
        if Comp is TComponent then
          Caption := TComponent(Comp).Name + '.' + GetName
        else
          Caption := GetName;
        Memo.Text :=GetStrValue;
        Memo.SelectAll;
        if ShowModal = mrOk then
          SetStrValue(Memo.Text);
      finally
        Free;
      end;
    end; { TCaptionEditor.Edit }function TCaptionEditor.GetAttributes: TPropertyAttributes;
    begin
      Result := inherited GetAttributes + [paDialog];
    end; { TCaptionEditor.GetAttributes }procedure TStrEditDlg.BtnAboutClick(Sender: TObject);
    begin
      MessageBox(Handle,'Copyright (C) Kingron 2002','Info',MB_OK+MB_ICONINFORMATION);
    end; { TStrEditDlg.BtnAboutClick }procedure TStrEditDlg.CreateParams(var Param: TCreateParams);
    begin
      inherited;
      Param.WndParent :=GetActiveWindow;
    end;end.
      

  10.   

    object StrEditDlg: TStrEditDlg
      Left = 283
      Top = 106
      BorderStyle = bsDialog
      Caption = 'String Editor'
      ClientHeight = 221
      ClientWidth = 347
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      OldCreateOrder = False
      Position = poDesktopCenter
      DesignSize = (
        347
        221)
      PixelsPerInch = 96
      TextHeight = 13
      object Bevel1: TBevel
        Left = 8
        Top = 11
        Width = 329
        Height = 161
        Anchors = [akLeft, akTop, akRight, akBottom]
        Shape = bsFrame
      end
      object Label1: TLabel
        Left = 17
        Top = 20
        Width = 139
        Height = 13
        Caption = 'Press Ctrl+Enter to break line:'
      end
      object Memo: TMemo
        Left = 16
        Top = 40
        Width = 313
        Height = 121
        Anchors = [akLeft, akTop, akRight, akBottom]
        HideSelection = False
        ScrollBars = ssVertical
        TabOrder = 0
        WantReturns = False
      end
      object BtnOK: TBitBtn
        Left = 176
        Top = 188
        Width = 75
        Height = 25
        Anchors = [akLeft, akBottom]
        Caption = '&OK'
        TabOrder = 1
        Kind = bkOK
      end
      object BtnCancel: TBitBtn
        Left = 264
        Top = 188
        Width = 75
        Height = 25
        Anchors = [akLeft, akBottom]
        Caption = '&Cancel'
        TabOrder = 2
        Kind = bkCancel
      end
      object BtnAbout: TBitBtn
        Left = 8
        Top = 188
        Width = 75
        Height = 25
        Anchors = [akLeft, akBottom]
        Caption = '&About'
        TabOrder = 3
        OnClick = BtnAboutClick
        Kind = bkHelp
      end
    end
      

  11.   

    感谢Kingron的奉献,感谢大家。