Temp := TRichEdit.Create(Self);
你如果用这种方式创建的话,Temp就是一个richedit,它拥有richedit所有属性和方法,你爱怎样用就怎样用.Temp.属性或方法

解决方案 »

  1.   

    都使用这种方法可以调用的,如果你想同时控制相同的控件的话,
    procedure TFMainForm.WetherShow(Show: Boolean; ComName: TComponent);
    begin
      if ComName is TdfsStatusBar then
      begin
        if Show then
          (ComName as TdfsStatusBar).Visible := True
        else
          (ComName as TdfsStatusBar).Visible := False;
      end;
      if ComName is TToolbar97 then
      begin
        if Show then
          (ComName as TToolbar97).Visible := True
        else
          (ComName as TToolbar97).Visible := False;
      end;
      if ComName is TPanel then
      begin
        if Show then
          (ComName as TPanel).Visible := True
        else
          (ComName as TPanel).Visible := False;
      end;
    end;          
    上面并不是你所要的,但是给你一点提示,使用is as
    要不你再具体一点,看有没有更好的方法.
    (我不是冲着专家分来的,如果能够解决问题的话,我会很开心)