Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Editable/Non-editable fields in form...

Posted on 1998-04-14
4
Medium Priority
?
308 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 150 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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 my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

715 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