getting mouse movement

Hello,

I've got a problem.
I've got a Form with in it some figures and some buttons.
Now is the problem that I want to let the figures move on the movement of the mouse as soon as I move the mouse over the dedicated button.

Is there someone that could help me with this problem.

Regards,

P675

Comments

  • : Hello,
    :
    : I've got a problem.
    : I've got a Form with in it some figures and some buttons.
    : Now is the problem that I want to let the figures move on the movement of the mouse as soon as I move the mouse over the dedicated button.
    :
    : Is there someone that could help me with this problem.
    :
    : Regards,
    :
    : P675
    :
    Hi
    You can move an image on a form with the following code

    [code]
    ....
    private
    l,t : integer;
    .....

    procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
    Shift: TShiftState; X, Y: Integer);
    begin
    l := x;
    t := y;

    end;

    procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
    Y: Integer);
    begin
    if ssLeft in Shift then
    begin
    Image1.left := Image1.left + (x-l);
    Image1.top := Image1.top + (y-t);
    end;
    end;

    [/code]
    SoftMan
    if I do not misundersand your question...
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion