Solved

How to disable vertScrollBar in TCheckListBox and use code to scroll

Posted on 2000-04-13
5
196 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

832 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