Is there any way to hide the scrollbars from Tlistview?

Asked

Viewed 206 times

0

Would have as Withdraws or Deactivate or Hide the Scrollbars vertical of TListView I didn’t find an option for this in the Object Inspector.

When I put in the ViewStyle vsReport there appears a Scrollbars Vertical wanted it to be hidden more when rolling with the mouse it acts as if the Scrollbars were there.

Ps: I am using Delphi 10.2 and accept suggestion of other components that work similar to the TListView

  • It has how to do but The mode I know does not work with the mouse....

1 answer

1

I did so and it works the matter of disappearing with the scroll bars of TListView the problem is that with these commands you can scroll the items with the keyboard with the mouse does not work...

private
    FListViewWndProc: TWndMethod;
    procedure ListViewWndProc(var Msg: TMessage);
public
   { Private declarations }
    FShowHoriz: Boolean;
    FShowVert: Boolean;
end;

implementation

procedure TForm1.ListViewWndProc(var Msg: TMessage);
begin
  ShowScrollBar(ListView1.Handle, SB_HORZ, FShowHoriz);
  ShowScrollBar(ListView1.Handle, SB_VERT, FShowVert);
  FListViewWndProc(Msg); // mensagem do processo
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  FShowHoriz           := False;                // esconder a barra de rolagem horiz
  FShowVert            := False;                // esconder a barra de rolagem vert       
  FListViewWndProc     := ListView1.WindowProc; // salvar janela antiga proc
  ListView1.WindowProc := ListViewWndProc;      // subclass
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  ListView1.WindowProc := FListViewWndProc; // restaurar o proc da janela
  FListViewWndProc     := nil;
end;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.