?
Solved

Hide vertical scrollbar of a listbox?

Posted on 1999-07-19
3
Medium Priority
?
962 Views
Last Modified: 2010-04-06
How can I hide the vertical scrollbar of a listbox and a checkboxlist and scroll them from code?

Thank you for your help,
Levente
0
Comment
Question by:Levente
[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 27

Accepted Solution

by:
kretzschmar earned 200 total points
ID: 1389491
hi levente,

so it goes

unit lb_nosb_u;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

//Hide Scrollbars
procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowScrollBar(ListBox1.Handle,SB_BOTH,False);
end;

//Scrool Up
procedure TForm1.Button2Click(Sender: TObject);
begin
  if Listbox1.TopIndex > 0 then
    Listbox1.TopIndex := Listbox1.TopIndex - 1;
end;

//Scroll Down
procedure TForm1.Button3Click(Sender: TObject);
begin
  if Listbox1.TopIndex < ListBox1.Items.Count - 1 then
    Listbox1.TopIndex := Listbox1.TopIndex + 1;
end;

end.

meikl
0
 
LVL 17

Expert Comment

by:inthe
ID: 1389492
nice unit name :-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1389493
;-)
lb_nosb_u
means
ListBox_NoScrollBars_Unit
;-)

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
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

719 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