473,761 Members | 2,410 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 1362
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
1954
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
1662
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
1211
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
1770
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
1481
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
1731
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
4473
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
1036
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
9336
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9948
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
9902
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,...
1
7327
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
6603
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();...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3866
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
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.