Solved

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

Posted on 2002-05-17
2
220 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
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…

823 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