Solved

How to disable vertScrollBar in TCheckListBox and use code to scroll

Posted on 2000-04-13
5
188 Views
Last Modified: 2010-04-04
I have a checklistbox full of records.  The user must be able to scroll and select records using a touch screen, therefore, I want to disable the vertScrollBar and use a couple of command button's on click evernts to do the scrolling functions.  
I have tried using the 'ScrollBy' procedure to do the scrolling, but it don't work.

Sorry, 22 points is all I have. :-(
0
Comment
Question by:jacksonrf
  • 3
  • 2
5 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 2713034
Hi,
you can try:

if Key = VK_F8 then
    SendMessage(checklistbox 1.Handle,WM_VSCROLL,SB_LINEDOWN,0)
else if Key = VK_F7 then
    SendMessage(checklistbox 1.Handle,WM_VSCROLL,SB_LINEUP,0);
end;


also SB_PAGEDOWN,SB_PAGEUP ETC..

Regards Barry
0
 

Author Comment

by:jacksonrf
ID: 2713197
Sorry.  Can you be more specific?
0
 
LVL 17

Expert Comment

by:inthe
ID: 2713378
er ok i mean something like this:

var
  Form1: TForm1;
  i : integer;
implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
i := checklistbox1.itemindex;
if (i = checklistbox1.Items.Count - 1) then exit
else begin
  SendMessage(checklistbox1.Handle,WM_VSCROLL,SB_LINEDOWN,0);
  checklistbox1.itemindex := (i + 1);
  end;
  end;

procedure TForm1.Button2Click(Sender: TObject);
begin
i := checklistbox1.itemindex;
if (i = 0) then exit
else begin
  SendMessage(checklistbox1.Handle,WM_VSCROLL,SB_LINEUP,0);
  checklistbox1.itemindex := (i - 1);
end;
end;
0
 
LVL 17

Accepted Solution

by:
inthe earned 22 total points
ID: 2713821
0
 

Author Comment

by:jacksonrf
ID: 2715567
You the man!  
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now