Editable/Non-editable fields in form...
Posted on 1998-04-14
I hvae a simple form with several fields from a database. These fields are represented using DBEdit, DBCheckBox. I also have some non-database related components such as TEdit, TCheckBox on the form.
Now, I would like suggestions to the best way of making the fields in the form editable (can received focus and user input from the mouse or tab) and non-editable (cannot receive focus).
You can imagine having a button on the form called 'Edit Form', and when it is pressed, the user can modify the contents of the edit boxes, etc. Otherwise, the form will appear read-only, preventing the user from editing the fields.
PS: I do not want to use the ReadOnly property because the component can still receive focus. I have tried setting the Enabled property to False, and this works except that the fonts in the edit boxes appear gray.