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
Title:
Subclassing a control
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01329290
Message ID:
01329290
Views:
52
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;
        }
    }
Linda Harmes
HiBit Technologies, Inc.
Next
Reply
Map
View

Click here to load this message in the networking platform