Solved

HeaderControl

Posted on 2004-09-18
4
685 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
[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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

729 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