473,761 Members | 8,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with inheriting from a windows form

Hi,

I have a base form from which i want all of my forms to inherit from. The
base form has three buttons anchored to the bottom right of the base form.
When i first inherit a new form from the base form everything seems to be
fine. The 3 buttons from the base form show up on the bottom right of the
inherited form. But as i started adding new controls and building it i found
that the 3 buttons from the base form disappeared. When i expanded the
inheriting form and rebuilt it the 3 buttons showed up but in a wrong
location. And as i play around with resizing the inheriting form the 3
buttons seems to appear and disappear erratically. I rebuilt the solution
everytime. The same control location appear even when i run the app. I am
using VS.NET 2005. Has anybody encountered this problem before? Am i doing
anything wrong or miss anything or is it just a problem with the IDE? Any
help on this issue will be greatly appreciated.

Thank You,
Vish
Jan 30 '06 #1
7 4965
First of all, did you set the three buttons' Anchor property to "Bottom
Left"?

Jan 30 '06 #2
Hi,

Yes, I sure did set the anchor property of the 3 buttons to "Bottom Right".
When i inherit a new form it comes up alright. It is after i start adding
controls to it that the behaviour becomes erratic.

Thank you,
Vish

"Vish" wrote:
Hi,

I have a base form from which i want all of my forms to inherit from. The
base form has three buttons anchored to the bottom right of the base form.
When i first inherit a new form from the base form everything seems to be
fine. The 3 buttons from the base form show up on the bottom right of the
inherited form. But as i started adding new controls and building it i found
that the 3 buttons from the base form disappeared. When i expanded the
inheriting form and rebuilt it the 3 buttons showed up but in a wrong
location. And as i play around with resizing the inheriting form the 3
buttons seems to appear and disappear erratically. I rebuilt the solution
everytime. The same control location appear even when i run the app. I am
using VS.NET 2005. Has anybody encountered this problem before? Am i doing
anything wrong or miss anything or is it just a problem with the IDE? Any
help on this issue will be greatly appreciated.

Thank You,
Vish

Jan 30 '06 #3
Odd. I've never had that problem.

Are the buttons "private" in the parent form? Remember that even with
Anchor set to "Bottom Right", the child form still has to set the
Location properties of the buttons if you resize the child, and it
can't do that if the buttons are "private". Try setting the buttons'
visibility to "protected" on the parent form and see if that fixes the
problem.

Jan 30 '06 #4
Hi Bruce,

Seems like setting the modifiers to protected fixed the problem atleast for
the new inheriting forms. I greatly appreciate your help.

Thank You,
Vish

"Bruce Wood" wrote:
Odd. I've never had that problem.

Are the buttons "private" in the parent form? Remember that even with
Anchor set to "Bottom Right", the child form still has to set the
Location properties of the buttons if you resize the child, and it
can't do that if the buttons are "private". Try setting the buttons'
visibility to "protected" on the parent form and see if that fixes the
problem.

Jan 30 '06 #5
Glad you've got it sorted.

I would also suggest that unless you want to add other buttons in the same
row the proper way to do this is to put them in a panel and dock the panel
to the bottom - I SUSPECT that this would solve your problems without
requiring protected fields.

"Vish" <Vi**@discussio ns.microsoft.co m> wrote in message
news:D8******** *************** ***********@mic rosoft.com...
Hi Bruce,

Seems like setting the modifiers to protected fixed the problem atleast
for
the new inheriting forms. I greatly appreciate your help.

Thank You,
Vish

"Bruce Wood" wrote:
Odd. I've never had that problem.

Are the buttons "private" in the parent form? Remember that even with
Anchor set to "Bottom Right", the child form still has to set the
Location properties of the buttons if you resize the child, and it
can't do that if the buttons are "private". Try setting the buttons'
visibility to "protected" on the parent form and see if that fixes the
problem.

Jan 31 '06 #6
Yes, it would. That's a better solution, I agree.

Docked objects don't need to be protected in the parent, since the
child never needs to modify their location or size. Objects placed
directly on the parent form that are Anchored other than Top Right need
to be protected, because the child form needs to modify at least their
Location, if not their Size, as it is resized.

Jan 31 '06 #7
Thanks for the suggestion guys. I would like the buttons to be private since
the inheriting forms should not modify the buuton property. Panel seems to be
be a good way to go. I wanted to get your thoughts on using a
toolstripcontai ner instead of a panel. Do you think it is appropriate or is
it overkill? I do anticipate adding another dropdownbutton to the "Bottom
Left" for "Options" like printing etc.

-Vish
"Bruce Wood" wrote:
Yes, it would. That's a better solution, I agree.

Docked objects don't need to be protected in the parent, since the
child never needs to modify their location or size. Objects placed
directly on the parent form that are Anchored other than Top Right need
to be protected, because the child form needs to modify at least their
Location, if not their Size, as it is resized.

Jan 31 '06 #8

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

Similar topics

2
3275
by: Tamlin | last post by:
Hi all, I'm getting a bug with the datagrid object. I've created one from scratch, bound it to a dataview with 2 int32 columns and formatted the output as currency. I've found that when you use the F2 key to enter edit mode and then hit TAB or ESCAPE without actually editing the value, dotnet crashes with a null reference error.
1
1420
by: Rasmus Kromann-Larsen | last post by:
Hey, I'm working on an application (questionaire) with alot of different question types (very different form layout)... But the questions share attributes, however - since I'm working in the .NET Compact Framework that doesn't support Inheriting Forms, and a form is required to inherit System.Windows.Forms.Form - and can only extend one class, how am I to build the thing without having to repeat my shared attributes (can make an...
2
3930
by: Darryn Ross | last post by:
Hi.. I have a standard windows app in C#. The project contains a two forms and one class that i have created. I want both of the forms to inherit from the class but i am getting an error reading "type in interface list is not an interface"??? i am not sure how to fix the problem. Is an interface (form) unable to inherit from a non interface type?? any help appreciated
4
6591
by: Michael C# | last post by:
Does anyone know of any sample code for inheriting from the FileDialog or CommonDialog classes? I need to create a customized OpenFileDialog with some additional combo boxes on it. Thanks
19
2987
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and provide an open TD with a DIV in it for the content of this formlet. (The DIV is for DHTML to hide and show the content) I've created a web page showing step by step the two problems I'm encountering. This problem is much easier to see than it...
5
1290
by: Ed Willis | last post by:
What is the best way to make a window read only for an inherited window. How do I access the all the controls such as textboxes etc. to make everything read only? I have an update window that I am inheriting and I am going to make the inherited window read only. Thanks.
3
4080
by: Roy Soltoff | last post by:
Two books, "Mastering Visual Basic.Net" and "Visual Basic.Net Developer's Handbook" describe inheriting from System.EventArgs using a class similar to: Public Class MyEventArgs Inherits System.EventArgs Public Shared MyField As String Public Sub New(Text As String) Me.MyField = Text End Sub
0
926
by: spam | last post by:
Sorry if this is the wrong group but I can't find one on the IDE. I am finding lots and lots of problems with it and I'm surprised I cannot find anyone else with the same problems. I'm using 2003 BTW. The problem that I have at the moment is I have created my own control by inheriting from ComboBox and this resides in a project. In another project (but in the same solution) I have been using this control with no problems. The projects...
1
1742
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 ctrl to create new 'ColorMixerX' ,following problem arises. Above process completes successfully,but when i try to bring up the Designer for newly created 'ColorMixerX' the Designer show following err msg : "An error occured while loading the...
0
9554
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
9376
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
9988
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
9923
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
8813
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...
0
6640
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
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
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.