Search code examples
windowsdelphidelphi-7

Delphi 7: Enabling automatic list of possible options for items I am working on?


I have recently started using Delphi 7 and am currently learning to make applications with it. I've read this while reading about the basics:

The picture that the Delphi Basics website used as an example

It says that Delphi helps us with a list of possible options for the item we are working on. Those possible options would help me a lot, as I currently have no idea what options there are, however, when I write, I get no possible options window, as shown bellow:

What happens when I start typing

Is it disabled by default, and if it is, where can I enable it? It also may be important to mention that I am using Windows 10, and that Windows 10 does warn me that Delphi might not work properly with my Windows, although I sincerely doubt that's the reason behind this, as the whole program works just fine.

Thank you in advance, and I apologize for such a rookie question :)


Solution

  • The feature you're looking for is called Code Insight. It's usually available automatically (the default is enabled).

    You can find it in the Tools->Options menu in the IDE. It's also documented in the help file.

    You enable Code Insight by using Ctrl+Space, either after typing the . or the first couple of letters of the property or type, as in

    Code Completion for Label1.Caption image

    Once the window is displayed, you can use the mouse or arrow keys to select the property or method you want to use. The most likely match is pre-selected (as you can see in the image), in which case you can just Enter to accept it.

    There are other features of Code Insight that you'll find useful, such as Code Completion, Code Parameter Hints, and Live Templates, all of which are also described in the help file. Search for Code Insight.