By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,719 Members | 1,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,719 IT Pros & Developers. It's quick & easy.

All controls on a form to read-only?

P: n/a
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 them hard to read and you
cant select/copy the contents of text boxes.

Thanks
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Paul Close" <su*****@computerdoctor.com.au> schrieb:
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 them hard to read and you
cant select/copy the contents of text boxes.


I doubt that this is possible without using replacements for some of the
controls. You'll find some replacements for common controls which support a
read-only mode. The article
<URL:http://www.codeproject.com/cs/miscctrl/ReadOnlyComboBox.asp> showcases
a read-only combobox control, for example. In addition to using replacement
controls you can selectively set controls to read-only mode or disable them
based on their type. To do that, recursively enumerate the controls on the
form and check their type using 'TypeOf...Is...'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

P: n/a
Addendum:
<URL:http://www.codeproject.com/cs/miscctrl/ReadOnlyComboBox.asp>


<URL:http://www.codeproject.com/useritems/CompleteReadOnlyComboBox.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3

P: n/a
Thanks. Good info.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Addendum:
<URL:http://www.codeproject.com/cs/miscctrl/ReadOnlyComboBox.asp>


<URL:http://www.codeproject.com/useritems/CompleteReadOnlyComboBox.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.