Saturday, November 3, 2007

ReadOnly controls

I had the problem, that I needed controls which can be set to ReadOnly in Visual Studio. Since I have not found a solution in the internet that fits my needs I decided to create my own controls and I would like to make them available to other persons who may need them. The controls where created with Visual Studio 2005 Express and the .NET Framework 2.0.

To make the controls even more customizable they provide in additon to the "ReadOnly" property two other properties:
  • ReadOnlyBackColor - specifies the back color of the control when it is in ReadOnly state.
  • ReadOnlyForeColor - specifies the fore color of the control when it is in ReadOnly state.
In the screenshots below you can see the impact of this properties. Only for the Checkbox the ReadOnlyBackColor is not available, because this color can be changed with the BackColor property.


To use the controls in your project simply drag and drop the dll file of the controls into your Visual Studio Toolbox.

Here some screenshots:

To download the source code of the demo form and the dll file see the following link:

No comments: