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 9153951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:21:18+00:00 2026-06-17T12:21:18+00:00

I have a button on a form. The button name is bmod2 , while

  • 0

I have a button on a form.
The button name is bmod2, while the form name is fLayOut1

When a user clicks the button I would like to save the name of the current form and button name

procedure TFLayout1.bMod2Click(Sender: TObject);
var
azone : string;
adept : string;
begin
azone := //forum name here
adept := //button name here
end;
  • 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-17T12:21:19+00:00Added an answer on June 17, 2026 at 12:21 pm

    To get name of the current form that the event method belongs to, you can access the Name property directly or through the hidden Self object as it’s shown in the commented line of code below.

    To get name of the component that has fired a certain event, in this case the OnClick event, you can use commonly used Sender parameter, which is (usually) the reference to the object, that caused the event to fire. Since the passed Sender parameter is of base TObject class type, which doesn’t have the Name property yet, you need to typecast this object to a type, that the Name property has. It might be directly a type of the object having the event binded or, if you are not sure with it, or if there might be more component types binded to an event, you can use e.g. the common TComponent ancestor class, which the Name property defines (as it’s shown in the commented line in the following code):

    procedure TFLayout1.bMod2Click(Sender: TObject);
    var
      azone: string;
      adept: string;
    begin
      azone := Name;
      // azone := Self.Name;
      adept := TButton(Sender).Name;
      // adept := TComponent(Sender).Name;
      ShowMessage('Form name: ' + azone + sLineBreak +
        'Sender name: ' + adept);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a submit buttom like this: <?php echo <form id='abottom' method='post'> <button name='.$row3[$ww].'
I have a form which code looks like this: <div id=right_sidebar> <form id=your_name name=your_name
In index.php I have a form: <form name=UserLocation action=propForSale.php method=GET> Once the user types
Watching multiple elements in a form, I would like to enable the submit button
For example, would like 5 checks boxes to have their own submit button and
I have a form with Name textbox Address textbox Phone textbox Insert buttion and
i have a form button in the form,which i need to perform basic action
I have button which post values of form to url but during post i
I have a button which creates form elements on click . My addelement function
I have... a dynamic populated select box several input boxes a submit button form

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.