473,472 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Inheriting Forms

I was working through one of the examples in Microsoft's VB.net resource
kit, following the instructions for adding an inherited form to a project.
The base form had a couple of Buttons one it. When I choose the "add
inherited form" option and select the base form, it creates a new instance
of the form just fine. I then added some additional controls to the new
form, and selected the Build option. As soon as the Build option is
completed, the two Buttons that were on the base form disappear from the new
form. Any idea what is going on?

Bob
Nov 20 '05 #1
5 1300
* "Robert A. Boudra" <Ro***********@urscorp.com> scripsit:
I was working through one of the examples in Microsoft's VB.net resource
kit, following the instructions for adding an inherited form to a project.
The base form had a couple of Buttons one it. When I choose the "add
inherited form" option and select the base form, it creates a new instance
of the form just fine. I then added some additional controls to the new
form, and selected the Build option. As soon as the Build option is
completed, the two Buttons that were on the base form disappear from the new
form. Any idea what is going on?


Which modifier did you select for the controls on the base form
'(Modifier)' "property"? Do the buttons show up when running the
application?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
I didn't make any changes to the Modifiers Property of the base form.
Apparently the default is "'Friend". After compiling, the buttons don't
show up on the new form either in design mode or during execution.

Bob

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Robert A. Boudra" <Ro***********@urscorp.com> scripsit:
I was working through one of the examples in Microsoft's VB.net resource
kit, following the instructions for adding an inherited form to a project. The base form had a couple of Buttons one it. When I choose the "add
inherited form" option and select the base form, it creates a new instance of the form just fine. I then added some additional controls to the new
form, and selected the Build option. As soon as the Build option is
completed, the two Buttons that were on the base form disappear from the new form. Any idea what is going on?


Which modifier did you select for the controls on the base form
'(Modifier)' "property"? Do the buttons show up when running the
application?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
Hi Robert,

I can not reproduce the problem, I test under the Windows XP+SP1,VS.NET 2003
Here is my reproduce steps.
1. add a button on form1
2. add form2 inherit from form1
3. add a buttn onto form2
4. set start object to form2
5. Press F5 to run the project
6. I can see button1 and button2 on the form2

Which version of VS.NET do you use?
Can you reproduce the problem with my steps?

Or can you modify your code as simple as possible as long as it can
reproduce the problem
and send to me by remove "online" from my email address.

If you have any concern, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #4
I'm using VS.net 2003. I was able to reproduce your project and results
below without any problems. The example I am doing is an MDI application
and the inherited form is an MDI child form. Could this have anything to do
with it?

Bob

"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:62**************@cpmsftngxa07.phx.gbl...
Hi Robert,

I can not reproduce the problem, I test under the Windows XP+SP1,VS.NET 2003 Here is my reproduce steps.
1. add a button on form1
2. add form2 inherit from form1
3. add a buttn onto form2
4. set start object to form2
5. Press F5 to run the project
6. I can see button1 and button2 on the form2

Which version of VS.NET do you use?
Can you reproduce the problem with my steps?

Or can you modify your code as simple as possible as long as it can
reproduce the problem
and send to me by remove "online" from my email address.

If you have any concern, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #5
Hi Robert,

I also try the MDI form, but I can not reproduce the problem.
Here is my test steps.
I have three forms(form1,form2,form3)

form3 is a MDI form and it is the start object
form1 has a button(Button1) on it.
form2 inherits form1 and it also add a Button2 onto it.

[Case1]
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim fm2 As New Form2
fm2.MdiParent = Me
fm2.Show()
Dim fm1 As New Form1
fm1.Show()
End Sub
[Case2]
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim fm1 As New Form2
fm1.MdiParent = Me
fm1.Show()
Dim fm2 As New Form1
fm2.Show()
End Sub

The two cases will alwarys display correctly.(form1 will have one button,
and form2 will have two buttons)
To identify the problem, I hope you can send me your code for me to
reproduce the problem. I will appreicate your efforts.
You may reach me by removing "online" from my email address.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #6

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

Similar topics

1
by: Yasutaka Ito | last post by:
Hi, I have a base form (FormBase), which defines things like the value of the WindowState. Other forms inherit from this base form to reflect the layout given in the base form. Is there a way...
3
by: thechaosengine | last post by:
Hi all, I wanted to put some common security functions into a class that inherits from the Page class and then use the new class as the basis for all my pages. Unfortunately, if I try and...
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: Charles Law | last post by:
I want a set of controls that all have a border, like a group box. I thought I would create a base control containing just a group box from which my set of controls could inherit. Assuming that...
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...
4
by: Xero | last post by:
Hello. I am using vb.net. There are two forms in my project. One is 'base' and the other one is 'savecurrent'. There is a value stored in a textbox called 'qc_a' in 'base'. I want to inherit...
3
by: Geraldine Hobley | last post by:
Hello, In my project I am inheriting several forms. However when I inherit from a form and add additional subroutines and methods to my inherited form I get all sorts of problems. e.g. I sometimes...
7
by: Vish | last post by:
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...
5
by: UJ | last post by:
I have a user control that inherits from the standard windows text box. I have a routine that adds stuff to it. I have compiled it into a dll. I have added it to my app and I can debug into it. I...
1
by: BillE | last post by:
Can I inherit from a web form? I would like to reuse procedures in a web form base class code behind by inheriting from it. For example, I would like to have a HandleError function defined in...
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...
0
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...
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...
1
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...
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...
0
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,...
1
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...
0
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...

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.