Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing a control
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01329290
Message ID:
01329291
Views:
16
>I am trying to create a class based on the mmTextBox class. I created a new class of UserControl, added the OakLeaf.MM.Main.Windows.Forms namespace and changed the parent class to mmTextBox. I then tried to change several properties, such as BackColor, Font, etc. I get an error when I compile indicating that the properties are readonly. How do I need to go about this? The code I tried is below. Thanks.
>
>
>    public partial class EditStatusTextBox : mmTextBox
>    {
>        public EditStatusTextBox()
>        {
>            InitializeComponent();
>            this.Text = "View";
>            this.BackColor.R = 255;
>            this.BackColor.G = 255;
>            this.BackColor.B = 128;
>        }
>    }
>
Try to set them through extra properties.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform