Q&A

  • ListBox에서 왼쪽에 생겨나는 스크롤바 없애는 방법 없나요?
안녕하셔요..영원한 델초보 어린왕자입니다..

고수님덜..

Listbox의 스크롤바를 없애구 싶어요..어떻게 해야할지요..

갈켜주셔요..



1  COMMENTS
  • Profile
    Black}{ole 2001.05.18 02:50


    type

    TMyListBox = class(TListBox)

    protected

    procedure CreateParams(var Params: TCreateParams); override;

    end;



    TForm1 = class(TForm)

    Button1: TButton;

    procedure FormCreate(Sender: TObject);

    procedure FormDestroy(Sender: TObject);

    private

    FListBox: TMyListBox;

    public

    end;



    var

    Form1: TForm1;



    implementation



    {$R *.DFM}



    { TMyListBox }



    procedure TMyListBox.CreateParams(var Params: TCreateParams);

    begin

    inherited CreateParams(Params);

    Params.Style := Params.Style and not (WS_VSCROLL or WS_HSCROLL);

    end;



    { TForm1 }



    procedure TForm1.FormCreate(Sender: TObject);

    var

    I: Integer;

    begin

    FListBox := TMyListBox.Create(Self);

    with FListBox do

    begin

    Left := 10;

    Top := 10;

    Height := 100;

    Width := 150;

    Parent := Self;

    for I := 0 to 50 do

    Items.Add(IntToStr(I));

    end;



    end;



    procedure TForm1.FormDestroy(Sender: TObject);

    begin

    FreeAndNil(FListBox);

    end;



    end.