473,386 Members | 1,958 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,386 software developers and data experts.

Override child control of inherited class

I'm trying to override the toolstripcontainer class to "skin" it and handle
some other things. The problem I'm having is that the container contains the
toolstrippanels

this.exToolStripContainer1.TopToolStripPanel.Contr ols.Add(this.exToolStrip1);

How can I override the OnPaint and OnPaintBackground of TopToolStripPanel?

Do I have to create an ExTopToolStripPanel tht inherits TopToolStripPanel
and do something like

this.exToolStripContainer1.ExTopToolStripPanel.Con trols.Add(this.exToolStrip1);

(seems like it will work but seems like a lot of work just to get at the
OnPaint methods since I don't need anything else)

it would be nice if I could do something like

protected override void TopToolStripPanel.OnPaint(PaintEventArgs e)

{

}

but obviously that doesn't work ;/ (not sure if its even semantically
correct)

Also, by doing this I end up "breaking" VS.Net's design features. I'm sure
theres a way to mimic them but I'm not sure how(I do get the properties to
work but these don't work in the toolbox well)? I don't really need to much
of an explination how but just needt o know if its possible(for later) and
if I can find good help on it(in MSDN or www).

Thanks,

Jon


Sep 30 '06 #1
0 1102

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

Similar topics

3
by: Omar Llanos | last post by:
I have Form1 and Form2 (which is inherited from Form1), and I created a button in Form2 that will fill up a textbox in Form1. What code would do that? I tried the simplest way: //from child...
14
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using...
8
by: JPRoot | last post by:
Hi M. Jeffrey Tan, Just hopping you didn't forget me? :) Thanks JPRoot ----- \"Jeffrey Tan\" wrote: -----
7
by: ad | last post by:
When a class (say class1) inherited form another class (Class0). The constructor in the class0 will be executing before the constructor of class1. Can we over the constructor?
18
by: bhavin | last post by:
Hi, Can someone point me to some good best practices kind of documentation on use of events compared to method overriding. Ex. In Windows Forms when should i have an event handler for Paint, and...
8
by: Keith Smith | last post by:
Could some one help me a little? I am trying to understand when/where you would ever want to use "protected override..." code such as this. How is this any different from creating a...
21
by: bonk | last post by:
Did anyone EVER come across the need to use "new" in a method declaration (breaking with inheritance / versioning)? Allthough I know what it does and how it is used I really have a hard time to...
14
by: Dave Booker | last post by:
It looks like the language is trying to prevent me from doing this sort of thing. Nevertheless, the following compiles, and I'd like to know why it doesn't work the way it should: public class...
1
by: Haroon07 | last post by:
Hi, I have a class in C# which receives data from the socket and inherits from Form. Whenever it receives data, it fires an event. ReceivedDone += new...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.