Einzelnen Beitrag anzeigen

Benutzerbild von sniper_w
sniper_w

Registriert seit: 11. Dez 2004
Ort: Wien, Österriech
893 Beiträge
 
Delphi 6 Enterprise
 
#2

Re: Scrollbares Label gesucht

  Alt 26. Feb 2005, 20:37
Delphi-Quellcode:
type
  TForm1 = class(TForm)
    ScrollBox1: TScrollBox;
    StaticText1: TStaticText;
    procedure FormCreate(Sender: TObject);
    procedure Memo1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
 var a:integer;
begin
randomize;
 for a:=0 to 10 do
 StaticText1.Caption :=StaticText1.Caption+ #10 + inttostr(random(100000))+ ' '+
 inttostr(random(100000))+ ' '+inttostr(random(100000))+ ' '+
 inttostr(random(100000))+ ' ';

 StaticText1.Width := ScrollBox1.Width;
 StaticText1.Height := ScrollBox1.Height;
end;

procedure TForm1.Memo1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
const sc_dragmove = $f012;
begin
  ReleaseCapture;
  StaticText1.Perform(wm_syscommand,sc_dragmove, 0);
end;
Und das ist ein Umweg.
Katura Haris
Es (ein gutes Wort) ist wie ein guter Baum, dessen Wurzel fest ist und dessen Zweige in den Himmel reichen.
  Mit Zitat antworten Zitat