Deselect control or disable cursor (1 Viewer)

monika_V

New member
Local time
Today, 07:10
Joined
Oct 7, 2021
Messages
9
Hello,

When you use AllowEdits = False on a form, is there any way of disabling the cursor?

It's slightly pedantic, but it is slightly annoying and gives the wrong indication in that it implies the control can still be changed as the cursor is accepted but it's not until you type that you realise the control is not editable and this can be too late!!

I had thought that it might be possible to just deselect the control when it is clicked on and AllowEdits = False but I cannot see anyway to do this.

Any thoughts on this?

Thank you.
 
Perhaps have a very small control on the form and set focus to that when allowedits is False

Edit: Sorry I meant False and have changed it to that. :(
However we are only talking about two key presses before you realise? :)
 
Last edited:
Hello,

When you use AllowEdits = False on a form, is there any way of disabling the cursor?

It's slightly pedantic, but it is slightly annoying and gives the wrong indication in that it implies the control can still be changed as the cursor is accepted but it's not until you type that you realise the control is not editable and this can be too late!!

I had thought that it might be possible to just deselect the control when it is clicked on and AllowEdits = False but I cannot see anyway to do this.

Any thoughts on this?

Thank you.
When and how do you set AllowEdits = False?

In the form's property sheet, or in a procedure?

If you do this in a procedure, you can also move focus to a control as Gasman says, and also change the control's properties so that it can't accept focus by setting

ctlYourControlNameGoesHere.Enabled = False

If you do that, of course, you'll need to reverse it and re-enable that control again at the appropriate time .
 
Any thoughts on this?
maybe add a Label Control, giving clue like "Form is read-only" or "Not editable".
or change the Font Color of each textbox to something lighter.
 
I agree with Arnel's suggestion - use a label with a suitable message - perhaps controlling it's visibility on the control's gotfocus event . Reason is, user may want to highlight and/or copy some text. Moving the focus so user cannot do this can be just as annoying - but does depend on what the from is about.
 
Nothing wrong with GPGeorge's suggestion of .Enabled = False to do what you want.

Another solution can be, if it is a data-entry screen then set TabStop= False to that field and the user will pass over it to the next edit field.
If you may want to edit that field for any reason then Set TabStop Off ; .Enabled = True ; Locked = True.
In normal data-entry the user tabs past it but you can have a Doubleclick() on the field to allow an edit by setting .Locked = False.
Then set .Locked back to True after editing.
 

Users who are viewing this thread

Back
Top Bottom