?
Solved

remove scrollbars from TlistListView

Posted on 2001-08-13
3
Medium Priority
?
435 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month7 days, 21 hours left to enroll

765 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