Solved

delphi trackbar with mouse events

Posted on 2009-04-03
2
2,761 Views
Last Modified: 2012-05-06
Hi experts,

  I am using delphi-7(pascal), I want trackbar with mouse up event. Please tell me how to get mouse up event for delphi normal trackbar. or please suggest me any free components for trackbar with mouse events.

0
Comment
Question by:inampudi1
  • 2
2 Comments
 
LVL 26

Accepted Solution

by:
EddieShipman earned 500 total points
ID: 24059812
Try this on for size:

unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls;
 
type
  TTrackBar = class(ComCtrls.TTrackbar)
  protected
    property OnMouseUp;
  end;
 
  TForm1 = class(TForm)
    TrackBar1: TTrackBar;
    procedure TBMouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
procedure TForm1.TBMouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  ShowMessage(IntToStr(x) + ':' + IntToStr(y));
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  TrackBar1.OnMouseUp := TBMouseUp;
end;
 
end.

Open in new window

0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 24081272
inampudi1, Have you had time to try the code?

It simply publishes the OnMouseUp for the trackbar control.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

820 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