Stop User Selecting Textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. This is probably a simple question needing a one-liner response.

I have textboxes on a form which just display a count of the record. How do
you stop the user being able to click on this textbox? I've disabled tab
stop but user can still click on the field.

TIA once again
rich
 
Set the Enabled property to False or you could put this in the On got Focus
event

SomeOtherControl.SetFocus
 
I know about the "enabled" property... but it greys out the fore colour,
overriding the colour set in the properties. Is there any way of disabling
the textbox but keeping its text shown in blue not grey?
 
Set its locked property to Yes instead. Also use the
SomeOtherControl.SetFocus so that if the user clicks in the box they are
immediately sent to some other box.
 
Rich1234 said:
I know about the "enabled" property... but it greys out the fore colour,
overriding the colour set in the properties. Is there any way of
disabling
the textbox but keeping its text shown in blue not grey?


You could set the locked property to true and the enabled to false to make
it look like a regular textbox. But this might be irritating for the user
if it looks the same, but cannot be selected.
 
Thanks guys. With enabled set to no and locked set to yes, the text isn't
greyed out (this was a surprise because it was greyed when just enabled and
locked were set to no .) I have given the box a transparent
background/borders so it doesn't look like a "box"

rich
 
Old thread, posting this for my future reference.

I needed to make an entire row of a continuous form do something when double clicked without selecting any of the textboxes. In the end, I placed a transparent button with no label on top of the entire row and set the on double click event to do whatever was needed to do. With no event, the button will just do nothing and nothing behind it will be selected.
 
Back
Top