Solved

HeaderControl

Posted on 2004-09-18
4
663 Views
Last Modified: 2008-01-09
I am using Delphi 4.  Does anyone know how to obtain the section index number if the section is clicked on with the RIGHT mouse button?
0
Comment
Question by:tayto
  • 2
4 Comments
 
LVL 9

Expert Comment

by:ginsonic
ID: 12096124
??????????????
0
 

Author Comment

by:tayto
ID: 12096685
ie: in the OnSectionClick event it does not pass the mouse button pressed - only HeaderControl: THeaderControl;
  Section: THeaderSection are passed - and if i use the OnMouseDown event the section:TheaderSection is not passed.

0
 
LVL 7

Accepted Solution

by:
LRHGuy earned 250 total points
ID: 12109204
Check this out: (You'll need to include CommCtrl in the uses)

procedure TForm2.HeaderControl1MouseUp(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
  Index: Integer;
  Info: THDHitTestInfo;
begin
  if Button=mbRight then begin
    Info.Point.X := X;
    Info.Point.Y := Y;
    Index := SendMessage(HeaderControl1.Handle,HDM_HITTEST,0,Integer(@Info));
    { Index has the section index, or -1 if not }
    if Index>=0 then
      // change header to X position...just testing
      HeaderControl1.Sections[Index].text:=IntToStr(Info.Point.X);
  end;
end;
0
 
LVL 7

Expert Comment

by:LRHGuy
ID: 12109205
Oops..I use Delphi 7...so I don't know if that'll work in D4..
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now