Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

remove scrollbars from TlistListView

Posted on 2001-08-13
3
Medium Priority
?
437 Views
Last Modified: 2010-04-04
Hello all

Is there a way to prevent the horizontal scrollbar to appear on a TListView ?

My Viewstyle is set to vsReport

thanks
0
Comment
Question by:fadyg
[X]
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
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
Tasomia earned 800 total points
ID: 6379557
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;

(code by TOndrej)
0
 
LVL 4

Expert Comment

by:fva
ID: 6379592
Why would yo uwant to do that?

Anyway, you might try this:
Set the minimum value=maximum value for that scrollbar using SetScrollInfo.

Raw example (not tested):

uses Windows;

procedure HideHSB(alv:TListView);
var lsi:TScrollInfo;
begin
     lsi.cbSize:=sizeof(TScrollInfo);
     lsi.fMask:=SIF_ALL;
     GetScrollInfo(alv.Handle,SB_HORZ,lsi);
     lsi.nPos:=lsi.nMin;lsi.nMax:=lsi.nMin;
     SetScrollInfo(alv.Handle,SB_HORZ,lsi,true);
end;

HTH,
F.
0
 
LVL 4

Expert Comment

by:fva
ID: 6379596
Well, I guess there's always a simpler way to do things. While I wrote my comment Tasomia's one came in and I guess it's more Delphi-oriented.

F.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

618 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