Solved

Editable/Non-editable fields in form...

Posted on 1998-04-14
4
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Multiple image collision 13 87
can't find the executable in Simulator 1 112
Delphi Yen format 3 58
Breakpoint doesn't stop in my variable 3 36
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

740 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