Read Only Controls

  • Thread starter Thread starter Vayse
  • Start date Start date
V

Vayse

I have a form, and I only want the user to be able to change the controls if
they click an Edit button.
I want the user to able copy the data from my controls, even without
clicking edit, so I want to leave the controls enabled.
I planned on putting "R" in the tags of the controls I want to be real
only, and coding like this:

Dim x As Control

For Each x In Me.Controls
If x.Tag = "R" Then
x.ReadOnly = True
End If
Next


So, when the form loads, I set my textboxes Readonly property to True.
However, there is no read only property on combo boxes and DateTimePickers.
What should on do in those cases?

Thanks
Vayse
 
Hi Vayse,

Thanks for your post.

Can you show me the exactly meaning of ReadOnly for
combobox/DateTimePicker, what behavior do you want? Thanks.

"Michel van den Berg" has provided you a useful link, in the link,
"Herfried K. Wagner [MVP]" finds the TextBox part of the combobox and set
it to readonly, does this meet your need? However we still have the problem
of whether or not to enable the dropdown function of
combobox/DateTimePicker, this is based on the function you want.

For TextBox, you want it to be selectable, so you do not want to use Enable
property, however for combobox/DateTimePicker, there should not be such
concern, can we disable these 2 controls to achieve what you want?

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi Vayse,

Does our replies make sense to you? Is your problem resolved? Please feel
free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top