Solved

Editable/Non-editable fields in form...

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month6 days, 9 hours left to enroll

634 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