Solved

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

Posted on 2002-05-17
2
223 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
[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 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Title # Comments Views Activity
Delphi Form ownership 4 160
Moving (cutting/pasting) controls in a TTabbedNotebook... 7 54
RESTRequest Parameter 4 85
can i put an image from resource into image tag ? 6 42
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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

759 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