Solved

HeaderControl

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

930 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

11 Experts available now in Live!

Get 1:1 Help Now