[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


TlistView and scrollbars

Posted on 2001-06-26
Medium Priority
Last Modified: 2007-11-27
Hi there,

I would like to be able to remove the horizontal scrollbar from a tlistview.

the listview has a viewstyle set to vsReport.

Question by:fadyg
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 13

Expert Comment

ID: 6228219
Keep the columns within the margins...

Accepted Solution

Cesario earned 300 total points
ID: 6228370
Hello fadyg

Try this ;-)

 TForm1 = class(TForm)
   ListView1: TListView;
   procedure FormCreate(Sender: TObject);
   procedure FormDestroy(Sender: TObject);
   FListViewWndProc: TWndMethod;
   procedure ListViewWndProc(var Message: TMessage);


{$R *.DFM}

procedure TForm1.ListViewWndProc(var Message: TMessage);
 ShowScrollBar(ListView1.Handle, SB_HORZ, False); // hide horiz scrollbar
 FListViewWndProc(Message); // process message

procedure TForm1.FormCreate(Sender: TObject);
 ListView1.Items[0].Left := 300;
 FListViewWndProc := ListView1.WindowProc; // save old window proc
 ListView1.WindowProc := ListViewWndProc; // subclass

procedure TForm1.FormDestroy(Sender: TObject);
 ListView1.WindowProc := FListViewWndProc; // restore window proc
 FListViewWndProc := nil;

This will hide the horizontal scrollbar again and again whenever it receives *any* message, which is
an overkill, normally you would only hide it after receiving specific messages making the scrollbar
visible. I don't know which these are... As I said, this example is very raw.

Best Regards


// This comment was postet 3 weeks ago

Author Comment

ID: 6252355
sorry for being late on this one,

as you said "very raw".
I tried to check which messages needed to be trapped but could not. So trapping them all is the best way. Overkill but works

thanks !

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question