Solved

I click on scrollbar or on left/right scrollbar button ?

Posted on 2002-05-17
2
222 Views
Last Modified: 2010-04-04
How can I detect if I click on left/right DBGrid scrollbar button or inside scrollbar ?
0
Comment
Question by:ginsonic
2 Comments
 
LVL 9

Accepted Solution

by:
ITugay earned 50 total points
ID: 7015777
Hi ginsonic,

  TForm1 = class(TForm)
  ...
  public
    OldWndProc: TWndMethod;
    procedure XWndProc(var M: TMessage);
  end;

.....

procedure TForm1.XWndProc(var M: TMessage);
begin
  if M.Msg = WM_HScroll then
  begin
    case LOWORD(M.WParam) of
      0: Caption := 'left button';
      1: Caption := 'right button';
      2,3: Caption := 'scroll area';
      5: Caption := 'middle bottom';
      //8: Caption := 'scrolled';
    end;
  end;
  OldWndProc(M);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  OldWndProc := DBGrid1.WindowProc;
  DBGrid1.WindowProc := XWndProc;
end;

------
Igor.
0
 
LVL 9

Author Comment

by:ginsonic
ID: 7016023
Perfect answer :)
Thanks again, Igor!

Regards,
Nick
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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