473,761 Members | 9,474 Online
Bytes | Software Development & Data Engineering Community
+ 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 1318
* "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.m icrosoft.com> wrote in message
news:62******** ******@cpmsftng xa07.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,for m2,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(ByVa l sender As System.Object, ByVal e As
System.EventArg s) 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(ByVa l sender As System.Object, ByVal e As
System.EventArg s) 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.(form 1 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
1299
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 to prohibit the inheriting form to change the value of the WindowState property? Appreciate any input/approach.
3
2668
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 inherit from my new SecurePage class and not the old Page class, the designer breaks and will only allow me into html mode. Bugger. The error message given is:
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
1813
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 this is the right approach (please tell me if it is not), how then do I make it so that the group box cannot be moved around on my set of controls, but is also able to act as container for other controls? If I leave the modifier of the group box...
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.
4
1365
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 it in 'savecurrent' when a button (located in 'savecurrent') is clicked. So a declared an Object varible, whose name is 'equation' in 'savecurrent' and typed in the following code:
3
2375
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 get MyVarialble is not declared errors when the variable is quite clearly declared, when I change it to public and then back again to private the error goes away!!! Also I get lots of member not found errors, these however don't stop me from...
7
4965
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 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...
5
1926
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 can see that the text changes but it doesn't actually update on the screen (the text itself is correct in the routine in the object but the display is wrong.) I've tried invalidating the object after I change the text but it still doesn't display...
1
1594
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 the base class code behind, which would then be available to any web forms code behind which inherited the base web form code behind. Is this supported? I can't find a way to do it.
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...
0
9811
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3911
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
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.