473,396 Members | 2,009 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,396 software developers and data experts.

Inheriting from UserControl

I have two classes, one that inherits from UserControl called Base. I
have a second class that inherits from Base. I do not want to expose
a lot of the properties of usercontrol beyond the Base control. For
example, lets say I want every control that inherits from Base to have
a RED background and not be able to change it. Currently,
backgroundcolor is available in the designer as a color choice. Can I
change the scope of something to disable that?

thanks

Sep 27 '07 #1
2 1280
Charlie,

Have a look if shadowing fits you.

http://msdn2.microsoft.com/en-us/lib...24(VS.80).aspx

Cor

"Charlie Brown" <cb****@duclaw.comschreef in bericht
news:11**********************@22g2000hsm.googlegro ups.com...
>I have two classes, one that inherits from UserControl called Base. I
have a second class that inherits from Base. I do not want to expose
a lot of the properties of usercontrol beyond the Base control. For
example, lets say I want every control that inherits from Base to have
a RED background and not be able to change it. Currently,
backgroundcolor is available in the designer as a color choice. Can I
change the scope of something to disable that?

thanks
Sep 27 '07 #2
Thanks, doesn't seem to do what I need. Also, when I set properties
on the Base control such as BackColor, the inherited controls default
to the UserControl default backcolor, not the color I set on the base
control.

On Sep 27, 1:06 pm, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
Charlie,

Have a look if shadowing fits you.

http://msdn2.microsoft.com/en-us/lib...24(VS.80).aspx

Cor

"Charlie Brown" <cbr...@duclaw.comschreef in berichtnews:11**********************@22g2000hsm.go oglegroups.com...
I have two classes, one that inherits from UserControl called Base. I
have a second class that inherits from Base. I do not want to expose
a lot of the properties of usercontrol beyond the Base control. For
example, lets say I want every control that inherits from Base to have
a RED background and not be able to change it. Currently,
backgroundcolor is available in the designer as a color choice. Can I
change the scope of something to disable that?
thanks- Hide quoted text -

- Show quoted text -

Sep 27 '07 #3

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

Similar topics

2
by: Kevin Blackwell | last post by:
This is probably a basic c# question, but I'm having problems with it. I currently have a project that contains two classes. From the calss view. Class1 Class2 I have included a usercontrol...
4
by: Joel Barsotti | last post by:
On certain pages I want to have a user control that is derived not directly from the usercontrol class, but from a class that extends the UserControl class so my objects will have a some...
4
by: Alan Silver | last post by:
Hello, I am displaying product details on a page and am allowing the site owner to specify the style in which the product details are displayed. I am debating which of two approaches to use here...
2
by: Charles Law | last post by:
I have a base class - ComponentBase - that inherits from UserControl. My class implements IComponentBase, which defines a minimal set of core properties and methods. All my other components inherit...
4
by: elziko | last post by:
I would like to do the following: Create a class that inherits from a usercontrol. Then add a control to the designer Call this new class ClassA. Many controls I need will start off like this...
3
by: YYZ | last post by:
I swear I've done my research, and now I was just hoping someone could explain this to me. I've got a base class (usercontrol) that I am using just as an interface. Meaning, I've defined...
9
by: Dominique | last post by:
I'm trying to create a C# composite control and have inherited from UserControl. This new control contains 9 buttons with images on them ( no text ). Firstly, what is the best way to expose...
4
by: DanG | last post by:
Howdy, On past .NET projects, I only had System.Web.UI.Page forms. One application needed a set of functions to do processing against the Page, Session and Request objects associated with the...
1
by: =?Utf-8?B?a2Fu?= | last post by:
hi, Consider i have built a UserControl say 'ColorMixer' in proj 'Step1'(Windows Control Proj). Now when create another proj 'Step2' as Windows Control and try adding 'ColorMixer' as inherited...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.