Solved

Editable/Non-editable fields in form...

Posted on 1998-04-14
4
290 Views
Last Modified: 2012-05-04
Hi

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.

Keith
0
Comment
Question by:keithcsl
4 Comments
 
LVL 2

Expert Comment

by:Waldek
ID: 1361523
Hmm , on enter to for ex. Edit You must  save value and on exit restore it :}
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1361524
keithcsl,

What about using ReadOnly and TabStop?

 If Readonly becomes true -> tabstop becomes false and vice versa?

Regards, Zif.
0
 
LVL 1

Author Comment

by:keithcsl
ID: 1361525
Zif,

Setting the ReadOnly and Tabstop to True and False respectively still allows the control to receive focus using the mouse.

Keith
0
 
LVL 1

Accepted Solution

by:
AndersWP earned 50 total points
ID: 1361526
I would seem to me that having the text go grey is a good visual cue to the user that editing is not possible. It is also consistent with the behaviour of W95 itself.

In other words, I would suggest using the Enabled property and regarding the greying of the text as a feature, not a bug.

Regards,
AndersWP
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
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…

757 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

21 Experts available now in Live!

Get 1:1 Help Now