Registriert seit: 24. Feb 2003
Ort: Graz (A)
705 Beiträge
Delphi 7 Enterprise
|
19. Mai 2003, 17:55
Ja.
1. Form1
2. Button1 draufkleben
3. Code...
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TNoVScrolllistbox = Class( TListBox )
private
procedure WMNCCalcSize( var msg: TMessage ); message WM_NCCALCSIZE;
end;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
ListBox2: TNoVScrolllistbox;
implementation
{$R *.DFM}
procedure TNoVScrolllistbox.WMNCCalcSize( var msg: TMessage);
var
style: Integer;
begin
style := GetWindowLong( handle, GWL_STYLE );
if (style and WS_VSCROLL) <> 0 then
SetWindowLong( handle, GWL_STYLE, style and not WS_VSCROLL );
inherited;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
listbox2.Items.add(' asfkljhasuilfhfuih fuihawiuh waeuifhw');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ListBox2 := TNoVScrolllistbox.create(self);
Listbox2.SetParent(Form1);
end;
end.
20 x Button 1 drücken, dann siehst Du es (oder eben nicht ).
Armin P. Pressler
BEGIN
...real programmers are using C/C++ - smart developers Delphi;
END;
|
|
Zitat
|