Current component

Posted on 2005-04-29
Last Modified: 2012-05-05

How can i get the name os current component selected on the form?

I'm build a delphi-like IDE and i need to know current component selected do make some changes and other things.
Question by:Jmaurin
    LVL 26

    Expert Comment

    by:Russell Libby
    The ActiveControl property of the form will return this

    LVL 11

    Expert Comment



    LVL 26

    Accepted Solution

    Its best to check the ActiveControl first, as it can be nil which would cause an access violation if the following was executed


    It should be changed to the something similar to the following (check for nil first):

      if Assigned(ActiveControl) then


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now