Search code examples
delphiautocompletedelphi-7

How autocomplete in delphi?


I am using Delphi 7, when I write code in the unit, I want autocomplete the words of the tree's objects.

For example, I have the next objets: LabelName, LabelEdge, LabelWindow, I want start write LabelN and have the possibility of autocomplete to LabelName.

Is it possible?


Solution

  • As David Heffernan said in the comments you need to press the CTRL+Space key in order for code insight to provide you with available choices for auto-completion.

    The available choices then depend on the part of the component name, method name, variable name, or constant name you have already written.

    They also depend on your current code scope which means that code insight won't provide you choice to use some method, variable or constant if it can't be accessed from the method you are writing code in (local variables/constants that belong to other methods, private members of a different class, etc.)

    You can invoke code insight to provide you choices even when you haven't written any partial name. In this case code insight will show you all available methods, variables, constants and objects (both components and classes) that can be accessed from within the current code scope. This is most useful when you are searching for specific method but you can't remember its name.