Solved

Editable/Non-editable fields in form...

Posted on 1998-04-14
4
295 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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

10 Experts available now in Live!

Get 1:1 Help Now