473,686 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question re Visual Inheritance in VS 2005

Hi,

I am thinking of using visual inheritance. I am using C# VS 2005. I
am concerned about how good it is. I have heard about problems like
controls dissapearing or so.

Any hints, tips, ideas, concerns ???

Thank you,
_dino_
Jan 25 '06 #1
3 1358
I have not tried Visual Inheritance in VS.NET 2005, mostly because it was
such a pain in the butt in VS.NET 2003. It worked, of course, but I can
personally attest that what you report is true.

Let us know what you find out.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Dino Buljubasic" wrote:
Hi,

I am thinking of using visual inheritance. I am using C# VS 2005. I
am concerned about how good it is. I have heard about problems like
controls dissapearing or so.

Any hints, tips, ideas, concerns ???

Thank you,
_dino_

Jan 25 '06 #2
Hi Dino,
I have done this in VS2005 and found I could do everything I wanted except
for inheriting from a generic form i.e.

class MyForm<T> : Form
{
....
}

which causes the derived form to not be able to be rendered in design view,
it works fine at runtime, but not much use unless you intend to create your
form blind. Apparently this is a known issue and not one that MSFT plan to
fix soon.

Mark

"Dino Buljubasic" wrote:
Hi,

I am thinking of using visual inheritance. I am using C# VS 2005. I
am concerned about how good it is. I have heard about problems like
controls dissapearing or so.

Any hints, tips, ideas, concerns ???

Thank you,
_dino_

Jan 26 '06 #3
Hi Peter,

Here is what I got from Markus Groenendijk on this topic. Maybe you
find it useful. I have decided to proceed without visual inheritance.
>
Hi Dino,

We use VI on forms extensively in VS 2003.
I'd definitely recommend using it. Dunno about problems in VS 2005
(seems OK so far) but in VS 2003 AFAIKS there's one problem which
might
cause problems when you're loading an inherited form.
To avoid this problem make sure you

1) use Me.DesignMode as appropriate.

Your client code in event handlers or overrides should
probably not be executed during design mode.

2) Use overrides rather than the event handlers.

So for ex. in VB I'd use:

Protected Overrides Sub OnLoad(ByVal e As System.EventArg s)

rather than

Private Sub ManagedForm_Loa d(...) Handles MyBase.Load

3) Make handlers overridable so you can override them in derived
forms. For
ex:

Private Sub btnOk_Click(... ) Handles btnOk.Click
OnOkClick()
End Sub

Protected Overridable Sub OnOkClick()
End Sub
4) Oh, and of course, use a version control system or have backups
handy ;-)

HTH & Regards,
Marius.
On Wed, 25 Jan 2006 12:50:03 -0800, "Peter Bromberg [C# MVP]"
<pb*******@yaho o.nospammin.com > wrote:
I have not tried Visual Inheritance in VS.NET 2005, mostly because it was
such a pain in the butt in VS.NET 2003. It worked, of course, but I can
personally attest that what you report is true.

Let us know what you find out.

Peter


Jan 27 '06 #4

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

Similar topics

4
385
by: aap | last post by:
Hi, I have the following code. #include <iostream> using namespace std; class Root { public: virtual void Root1() = 0; virtual void Root2() = 0;
30
1940
by: Elhanan | last post by:
hi all i have a question in desgning a form.. the application in question is something a indexing station. the user in this indexing station views a document in pdf/tiff format on the right side of the form and enters the index data through various fields and listboxes on the left side.
5
1653
by: Billy Cormic | last post by:
Hello, Does anyone know if we will be able to inherit web controls from web forms in Visual Studio 2005. This has been a source of constant frustration for me with the other versions. For example, will I be able to put buttons on a web form named webform1 and be able to show those buttons on a new web form named webform2 simply by inheriting webform1 on webform2? Thanks, Billy
1
1207
by: Martin Horn | last post by:
Hi all, does anyone know if inheritance of Form Classes is particularly prone to problems in VB 2005, or is it that I'm doing something wrong, as I keep getting unexpected problems with the designer of the class that is inheriting the form class. Thanks, Martin Horn.
6
1765
by: Peter Oliphant | last post by:
I just discovered that the ImageList class can't be inherited. Why? What could go wrong? I can invision a case where someone would like to add, say, an ID field to an ImageList, possible so that the individual elements in an array of ImageList's could be identified by the ID, thereby allowing re-ordering the array without harm. A person could identify by index into the array, but that would not be preserved by re-ordering (and re-ordering...
1
1475
by: leorochab | last post by:
Hi all, I am in trouble with visual inheritance in VS 2005, using C#. I can´t inherit any container control. They appear with a padlock, even setting the "MODIFIERS" property (PUBLIC/PROTECTED) for it and her items. :confused: Thanks for who can help me.
4
1725
by: MikeB | last post by:
I've been all over the net with this question, I hope I've finally found a group where I can ask about Visual Basic 2005. I'm at uni and we're working with Visual Basic 2005. I have some books, - Programming Visual Basic by Balena (MS Press) and - Visual Basic 2005 by Willis (WROX), but they don't go into the forms design aspects and describing the various controls at all. What bookscan I get that will cover that?
7
4467
by: jason | last post by:
In the microsoft starter kit Time Tracker application, the data access layer code consist of three cs files. DataAccessHelper.cs DataAcess.cs SQLDataAccessLayer.cs DataAcccessHelper appears to be checking that the correct data type is used DataAcess sets an abstract class and methods
4
1032
by: RSH | last post by:
Hi, I have been construction a sample application to further my growth in applying OOP concepts in .Net. My code is structured like this: Person |-- Employee |--- Customer
0
8580
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8931
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8765
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8777
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7596
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6437
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2943
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2203
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.