[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

TlistView and scrollbars

Posted on 2001-06-26
3
Medium Priority
?
2,327 Views
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.

0
Comment
Question by:fadyg
3 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6228219
Keep the columns within the margins...
0
 
LVL 8

Accepted Solution

by:
Cesario earned 300 total points
ID: 6228370
Hello fadyg

Try this ;-)


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

implementation

{$R *.DFM}

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

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

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

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

Cesario

// This comment was postet 3 weeks ago
0
 

Author Comment

by:fadyg
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 !
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month19 days, 1 hour left to enroll

834 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