473,441 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,441 software developers and data experts.

Read Only Controls

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
Nov 23 '05 #1
5 1777
Hey Vayse,

Have a look at:
http://groups.google.com/group/micro...a7b76a2b2462c2

Hope it will help you,

Michel van den Berg
"Vayse" <Va***@nospam.nospam> schreef in bericht
news:uy**************@TK2MSFTNGP12.phx.gbl...
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

Nov 23 '05 #2
You can maybe use the .Enabled-property?

"Vayse" <Va***@nospam.nospam> wrote in message
news:uy**************@TK2MSFTNGP12.phx.gbl...
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

Nov 23 '05 #3
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.

Nov 23 '05 #4
Have a look at my July 2005 article from http://emoreau.s2i.com/

--
HTH

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
(http://aspnet2.com/mvp.ashx?EricMoreau)
Conseiller Principal / Senior Consultant
Concept S2i inc. (www.s2i.com)
http://pages.videotron.com/emoreau/

"Vayse" <Va***@nospam.nospam> wrote in message
news:uy**************@TK2MSFTNGP12.phx.gbl...
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

Nov 23 '05 #5
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.

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Julie | last post by:
I'm wondering what standard/best practices are for the following scenario: I have a page representing several fields for stored data. If the user has sufficient access privileges, the page is...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
3
by: Paul Close | last post by:
How does one make all controls on a Windows form read-only? Controls such as check boxes, combo boxes and date time pickers dont appear to have a read-only property. Disabling the controls makes...
14
by: MLH | last post by:
I use A97. I've gotten used to reading values from textbox controls on forms, I've come to rely on it pretty heavily. My habit spills over into reports. I'm uncertain whether I can reliably read...
2
by: Vish | last post by:
Hi, I amplanning on having a rea-only and edit states for my form. But it do not want my form and its controls to look different or disabled. I am planning on having a edit button that brings...
4
by: CrimeMaster | last post by:
HI I have an Exe file when it runs ,there are just two controls on the window.One is a ListBox and another is a Multi line Rich Edit control.When i click on an item in the list some text is...
1
by: ncjed | last post by:
First off, my apologies if this topic has previously been covered. I am in the process of creating an A2K DB (Win XP) that will open other DBs (either on local drive, mapped drives, or UNC network...
23
by: Dan Tallent | last post by:
A textbox has a attribute for ReadOnly. This seems like such a simple concept. When a textbox is set to read only the user cannot change the contents of the field. I have been trying to find...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.