Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2002-05-17
2
Medium Priority
?
226 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 200 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

688 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