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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:11:41+00:00 2026-06-18T23:11:41+00:00

my application has 350 edit fields and all of them shall have an OnMouseMove

  • 0

my application has 350 edit fields and all of them shall have an OnMouseMove event.
I have generated this code for all of them:

...

type

...    
procedure Edit1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
procedure Edit2MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);    
...

implementation

{$R *.dfm}

...    
procedure TForm1.Edit1MouseMove(Sender: TObject; Shift: TShiftState; X,  
  Y: Integer);  
begin 
  Edit1.SetFocus(); 
end;

procedure TForm1.Edit2MouseMove(Sender: TObject; Shift: TShiftState; X,  
  Y: Integer);
begin 
  Edit2.SetFocus(); 
end;    
...

But I didn’t go to the object inspector to doubleclick OnMouseMove.
Is there a way to make this work without the object inspector.
Do you have an example line of code that would make it work for the first edit field?

  • 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-18T23:11:42+00:00Added an answer on June 18, 2026 at 11:11 pm

    You can create it once and assign it in code yourself:

    type
      TForm1=class(TForm)
        procedure EditMouseMove(Sender: TObject; Shift: TShiftState;
          X, Y: Integer);
        procedure FormCreate(Sender: TObject);
        //...
      end;
    
    implementation
    
    procedure TForm1.EditMouseMove(Sender: TObject; Shift: TShiftState;
      X, Y: Integer);
    var
      CurrEdit: TEdit;
    begin
      if (Sender is TEdit) then
      begin
        CurrEdit := TEdit(Sender);
        // Do whatever with CurrEdit
      end;
    end;
    
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      Edit1.OnMouseMove := EditMouseMove;
      Edit2.OnMouseMove := EditMouseMove;
      Edit3.OnMouseMove := EditMouseMove;
    end;
    

    If you want to assign the same one to every TEdit on the form:

    procedure TForm1.FormCreate(Sender: TObject);
    var
      i: Integer;
    begin
      for i := 0 to ControlCount - 1 do
        if Controls[i] is TEdit then
          TEdit(Controls[i]).OnMouseMove := EditMouseMove;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application has multiple SQLite tables(around 20 with different fields). This I have created
I have this code. I want to exit my Java Application if it detects
Application has an auxiliary thread. This thread is not meant to run all the
My application has one activity which starts two services but does not bind them.
My Application has 3 activities (MainActivity,SampleActivity,TempActivity) and Application have to start from MainActivity because
The application has been put in iCloud since the beginning, so I have the
I have a WPF (C# and .NET 4) application that has a long running
I have an application, which has a Spinner that I want populated with some
My application has a form to update an Event. I'd like to be able
My application has an sqlite DB, where some of the fields are null or

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.