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

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 4934
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**@discussions.microsoft.com> wrote in message
news:D8**********************************@microsof t.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
toolstripcontainer 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
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...
1
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...
2
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...
4
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
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...
5
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...
3
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...
0
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...
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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?
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
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...

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.