Solved

HeaderControl

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

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…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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