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

Can't add controls on inherited form

I can't seem to add new controls to form that is inherited from another
form.

I have BaseForm wich have table layout on it 2 panelsm and some buttons.
Now i create InheritedForm : BaseForm and want to add some new controls and
add them to pannels
but i can't drag and drop them ... designer does not allow me. Why is that ?

Panels and table layout modifiers is set to public.

I could not add my test solution to this post, cuz it said it's too big. I
dono why.. it's under 1mb ?
Please download it from :
http://www.svara-kontrole.lv/silo/Fo...nceExample.rar


Sep 27 '06 #1
4 16209
I also uploaded this solution to our sharepoint.
If previous link doesn't work.

You can get it here:

http://projekti.nexum.lv/nexum/files...nceExample.rar
username: nexumservices\msguest
password: msguest

"Mikus Sleiners" <mi*@newsgroups.nospamwrote in message
news:Oy*************@TK2MSFTNGP06.phx.gbl...
>I can't seem to add new controls to form that is inherited from another
form.

I have BaseForm wich have table layout on it 2 panelsm and some buttons.
Now i create InheritedForm : BaseForm and want to add some new controls
and
add them to pannels
but i can't drag and drop them ... designer does not allow me. Why is that
?

Panels and table layout modifiers is set to public.

I could not add my test solution to this post, cuz it said it's too big. I
dono why.. it's under 1mb ?
Please download it from :
http://www.svara-kontrole.lv/silo/Fo...nceExample.rar


Sep 27 '06 #2
Hi Mikus,

Generally speaking, when we set the Modifiers property of a control on a
base form to 'Public' or 'Protected', we can configure this control on an
inherited form just like on the base form.

However, many new controls of VS2005 didn't take the visual inheritance
scenario into account when originally designed. That's to say, even if we
set the Modifiers property of these control to 'Public' or 'Protected' on
the base form, we can not configure them on an inherited form.

These controls that don't support visual inheritance are listed below.

ToolStrip, MenuStrip, ContextMenuStrip and StatusStrip
ToolStripContainer
ToolStripPanel
SplitContainer
TableLayoutPanel
FlowLayoutPanel
DataGridView
MaskedTextBox
WebBrowser

Although we can not configure these control on the inherited form in the
designer, we could still access them by code, e.g. add a control in the
TableLayoutPanel.

Hope this helps.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 28 '06 #3
Although we can not configure these control on the inherited form in the
designer, we could still access them by code, e.g. add a control in the
TableLayoutPanel.

Hope this helps.
It might help Mikus but it doesn't help me.

I'm writing an app where I have a form which is inherited by 10 or so
other forms. On it I have a panel. I have recently added functionality
on an inherited form to put more controls "alongside" the panel. As
they were all related and sometimes needed to be hidden, I put them in
a second panel. Hopeless! Every time I build the project the 2nd panel
resizes itself (trebles in size, at least) and the form resizes. It's
nothing to do with code in the form onload event (been there, if
designtime'd that), it just won't stay the original size. So, I've had
to ditch the panel and replace it with a group box.

I now want to put similar 2nd "panels" in all the forms, so back to the
base form, and knowing a 2nd panel wouldn't work (and required quite a
bit of controling) I went for a splitcontainer - it's perfect for the
task. Until I discovered it's useless. "Doesn't support inheritance in
the designer 'cos the developers of an object oriented development
environment didn't take visual inheritance into account when designing
a visual control". Have the team concerned been put up against a wall
and shot? No? Well, they should have been! A great product made better
by the addition of some excellent new controls, but let down by shoddy
management - who the hell was responsible for controling that part of
the development?

As to adding the controls into the inherited forms in the code, what a
laugh! I've around 60 controls on some of the forms. What's the point
of a visual designer if I have to do it all by hand.

No, stuff it. I'll have to put the "2nd panel" in a group box on the
main form, and the appropriate control to hide it when applicable. Oh,
I should mention the major control in the "2nd panel" is a
DataGridView. What's that you say - oh, yes, that doesn't support
visual inheritance at design time either.

As this is a very public arena, I'll just say I'm extremely displeased.
It's a good job we haven't got to the point where my verbal background
comments are automatically picked up and included in postings.

Oct 26 '06 #4
Ok, maybe it's me that needs putting up against a wall and shooting! I
should not have posted until I'd actually tried what the poster above
said didn't work, ie. changing the modifier to Public. I did this to
the splitcontainer and the datagridview I placed in the right panel,
and everything works a treat in the inheriting form. I can drop
controls into the splitcontainer with no problem. Resizing does not
happen at build time and I can add controls in the designer. Indeed, I
took my version one form, selected all the controls below form level,
copied and pasted them into the left panel of my version 2 inheritng
form, and hey presto, I had my new format form in seconds.

So, I am eating humble pie in public as I'm not too proud to admit I
was hasty in my response (mind you, if Microsoft don't think this
should have worked because they didn't develop the control with visual
inheritance in the designer in mind, my comments weren't totally out of
order). Anyway, it's right I do this just in case anyone else is having
a similar problem, searches, and finds the negatives above. If you are
that person, all is NOT lost - just try it and see if it works for you!

Oct 30 '06 #5

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

Similar topics

1
by: petards | last post by:
I am inheriting from a form that has a tab control on it. The tab control has two pages. I can't seem to access the second page in the designer for the inherited form in order to drop controls on...
3
by: Wojciech Trelak | last post by:
Hi, Does anyone know how to change an owner of a control inherited from the base form? In code it's simple, but the real question is how to force designer to do this? Is it possible? I tried...
0
by: Frnak McKenney | last post by:
I'm running into problems with VisualStudio.NET2003 and Windows Forms inheritance. It _feels_ like a bug, but it could just as well be a misunderstanding on my part regarding how the VS Designer...
13
by: Lorne Smith | last post by:
Hi, First, sorry for the crosspost, but it seemed appropriate... :) I've come accross what I consider to be a bug, but I don't know if it's already known or not. (VS .Net 2003 Pro - VB.Net) ...
4
by: dbuchanan | last post by:
Is the following behavior normal? Both the 'Protected sub' in the inherited form and the 'Private Shadows sub' in the derived form fires. My interpretation of MSDN help on the topic "Shadows"...
4
by: asad.naeem | last post by:
hi to all this is the problem about inheritence. I have designed a form with some essential controls which are required for every form which will inherited from it. for example i have Button1 on...
4
by: EmilH | last post by:
Hi. I couldn't find it in msdn. I have a form AddCategory. Now I need EditCategory form which should look exactlay like AddCategory. I add an inherited form to the project. Now all controls'...
0
by: Paul W | last post by:
Hello everyone, My problem is with an inherited Form. The base Form has a few controls on it that are anchored such that they move as the Form is resized. While in the designer, the inherited...
4
by: Phil | last post by:
VS 2008 I have a windows form that was created in the normal way using the form designer. I do not wish to use this form directly though, I want to use it as a basis for some other forms. I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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,...
0
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,...
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
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...

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.