1. Computing
in Delphi Tips :: In any decently complex form design you will probably have edit controls (edit boxes, drop down lists, radio buttons, check boxes, etc) contained within a parent container control (TPanel, TGroupBox, ...).
In any data aware (database) application you probably have db-aware controls dropped on some container connected to a TDataSource connected to a TDBNavigator.
When you click the "Edit" or "Insert" buttons on the DBNavigator you want the "first" control in the group to receive the input focus - to allow for faster data input.

Read the full article to learn how to Focus the First Entry Control in a Container

Related:

Comments
May 7, 2010 at 5:00 am
(1) Silver Warior says:

Nice aproach. But if you for instance put a TButton on a group box before you put any Edit boxes your code will aways set focus to this Button. Why? Becouse TButton is also TWinControl.

May 7, 2010 at 5:50 am
(2) Zarko Gajic says:

@Silver: Yes, you’re right. Could apply some refactoring….

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.