Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8737279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:29:07+00:00 2026-06-13T10:29:07+00:00

I have a shape, when i click OnMouseDown in Object inspecter / Events tab.

  • 0

I have a shape, when i click OnMouseDown in Object inspecter / Events tab. I would like for it to do the procedure “SelectMessage” But its not showing up as an option. Also if i manually type in “SelectMessage” I get error Property and method Selectmessage are not compatible.

Selectmessage

procedure TFZone1Mod7.Selectmessage(sender: TObject);
var
  ShapeOrderNo: Integer;
begin
  if TryStrToInt(copy(TShape(Sender).Name,6,MaxInt),ShapeOrderNo) then
    begin
      LookUpMessage(ShapeOrderNo);
    end;
end;

If i do

procedure TFZone1Mod7.Shape1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
   selectmessage(sender);
end;

then it will work. but easier to select from events if i can.
thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:29:08+00:00Added an answer on June 13, 2026 at 10:29 am

    The event handler for an OnMouseEvent must have a signature of this form:

    procedure (Sender: TObject; Button: TMouseButton; 
        Shift: TShiftState; X, Y: Integer) of object;
    

    The component is going to call your event handler passing all those parameters, and your event handler must be of the expected form.

    You have no control over this. The component has a pre-determined, hard-coded form for its event handlers. You simply have to fit in. Your current solution is the correct one.

    Having said that, SelectMessage can only work when it is passed a TShape. So declare the function that way:

    procedure TFZone1Mod7.SelectMessage(Shape: TShape);
    var
      ShapeOrderNo: Integer;
    begin
      if TryStrToInt(copy(Shape.Name,6,MaxInt), ShapeOrderNo) then
        LookUpMessage(ShapeOrderNo);
    end;
    

    And call it like this:

    procedure TFZone1Mod7.Shape1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
      SelectMessage(Sender as TShape);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems that the WPF Rectangle shape does not have the Click event defined.
Im trying to add click events to shapes within a visio file.. I have
I have a SVG which contains text within a rectangle . I would like
I have a shape file, and I want to show it on the web
I have a shape in Visio which is a group. The group shape can
I have a Shape class containing potentially many vertices, and I was contemplating making
I have this: shape = (2, 4) # arbitrary, could be 3 dimensions such
I have two questions about java.awt.Shape . Suppose I have two Shape s, shape1
Lets say I have an irregular shape in png format.As you know this shape
Here is a problem I am trying to solve: I have an irregular shape.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.