Solved

HeaderControl

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

Industry Leaders: 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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

735 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