473,394 Members | 1,737 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.

New Form call from Inherited Form

This one has me stumped. I have a base form I am trying to wrap up, but I
have one problem. In two functions I am opening a "record detail" form. I
would like to keep the code in the base form and pass info to the form
telling it which from to actually open. Any ideas how to do this? Here is
an example of what I had in mind if the text isn't clear enough...

Base Form

Function EditRecord()
Dim frmRecord as New Form()
frmRecord.Filter = "ID = 2"
frmRecord.Show()
End Function

In the non inherited version of my form, I can easily declare the frmRecord
variable as the actual form needed to view the detail. But I want the
frmRecord to take on the attibutes of Form_Employee_Detail, or
Form_Invoice_Detail, or Form_Transaction_Detail, etc. I think you get the
idea.

Any help would be greatly appreciated! Thanks!

John A. Prejean
jo**@gcit.net
Nov 20 '05 #1
3 1510
Any instance of a derived type can be set back to a variable of the base
type. As long as the ID that you want to filter on is the same between all
derived forms, you can do this. Use the derived form's constructor to set
the filter criteria for the record

Class Employee_detail_Form
inherits BaseForm

sub new()
frmRecord.Filter = "ID = 2"
end sub
end class

Class BaseForm
Function EditRecord()
Dim frmRecord as New Form()
frmRecord.Show()
End Function
end Class
--------------------
From: "John A. Prejean" <jo**@gcit.net>
Subject: New Form call from Inherited Form
Date: Mon, 16 Feb 2004 12:47:13 -0600
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#h**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: wsip-68-14-193-229.no.no.cox.net 68.14.193.229
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!cpmsftng xa10.phx.gbl!TK2MSFTNGXA05
.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gblXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:181862
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

This one has me stumped. I have a base form I am trying to wrap up, but I
have one problem. In two functions I am opening a "record detail" form. I
would like to keep the code in the base form and pass info to the form
telling it which from to actually open. Any ideas how to do this? Here is
an example of what I had in mind if the text isn't clear enough...

Base Form

Function EditRecord()
Dim frmRecord as New Form()
frmRecord.Filter = "ID = 2"
frmRecord.Show()
End Function

In the non inherited version of my form, I can easily declare the frmRecord
variable as the actual form needed to view the detail. But I want the
frmRecord to take on the attibutes of Form_Employee_Detail, or
Form_Invoice_Detail, or Form_Transaction_Detail, etc. I think you get the
idea.

Any help would be greatly appreciated! Thanks!

John A. Prejean
jo**@gcit.net


Nov 20 '05 #2
Couldnt you just expose the entire form.

Private mfrm_RecordForm as RecordFormType = new RecordFormType

BaseForm
Public Readonly Property RecordForm()as RecordFormType
return mfrm_RecordForm
End Property
End BaseForm

then inside anyother classes you would use (baseform.recordform.filter = "ID
= 2")

Bryan Martin
sp**@ahwayside.com
"John A. Prejean" <jo**@gcit.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
This one has me stumped. I have a base form I am trying to wrap up, but I
have one problem. In two functions I am opening a "record detail" form. I would like to keep the code in the base form and pass info to the form
telling it which from to actually open. Any ideas how to do this? Here is an example of what I had in mind if the text isn't clear enough...

Base Form

Function EditRecord()
Dim frmRecord as New Form()
frmRecord.Filter = "ID = 2"
frmRecord.Show()
End Function

In the non inherited version of my form, I can easily declare the frmRecord variable as the actual form needed to view the detail. But I want the
frmRecord to take on the attibutes of Form_Employee_Detail, or
Form_Invoice_Detail, or Form_Transaction_Detail, etc. I think you get the
idea.

Any help would be greatly appreciated! Thanks!

John A. Prejean
jo**@gcit.net

Nov 20 '05 #3
The problem is the form I am trying to open is neither the derived nor base
form. This is what I have...

Class Employee_Detail_Form
....
End Class

Class Invoice_Detail_Form
....
End Class

Class BaseListForm
Function EditRecord()
?? Dim frmRecord as New Employee_Detail_Form()
?? Dim frmRecord as New Invoice_Detail_Form()
frmRecord.Show
End Function
End Class

Class EmployeeListForm
Inherits BaseListForm

''' When call is made from this form, I want it to use
Employee_Detail_Form
End Class

Class InvoiceListForm
Inherits BaseListForm

''' When call is made from this form, I want it to use
Invoice_Detail_Form
End Class
How can I get the call to be a variable that can change based on a
parameter. I already have it setup to override certain functions. But I
could really clean up the processes if I can get past this hurdle.

Thanks!!!

"Dot Net Team [MSFT]" <vb******@online.microsoft.com> wrote in message
news:Uj**************@cpmsftngxa07.phx.gbl...
Any instance of a derived type can be set back to a variable of the base
type. As long as the ID that you want to filter on is the same between all derived forms, you can do this. Use the derived form's constructor to set
the filter criteria for the record

Class Employee_detail_Form
inherits BaseForm

sub new()
frmRecord.Filter = "ID = 2"
end sub
end class

Class BaseForm
Function EditRecord()
Dim frmRecord as New Form()
frmRecord.Show()
End Function
end Class
--------------------
From: "John A. Prejean" <jo**@gcit.net>
Subject: New Form call from Inherited Form
Date: Mon, 16 Feb 2004 12:47:13 -0600
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#h**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: wsip-68-14-193-229.no.no.cox.net 68.14.193.229
Path:

cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!cpmsftng xa10.phx.gbl!TK2MSFTNGXA05 phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:181862
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

This one has me stumped. I have a base form I am trying to wrap up, but Ihave one problem. In two functions I am opening a "record detail" form. Iwould like to keep the code in the base form and pass info to the form
telling it which from to actually open. Any ideas how to do this? Here isan example of what I had in mind if the text isn't clear enough...

Base Form

Function EditRecord()
Dim frmRecord as New Form()
frmRecord.Filter = "ID = 2"
frmRecord.Show()
End Function

In the non inherited version of my form, I can easily declare the frmRecordvariable as the actual form needed to view the detail. But I want the
frmRecord to take on the attibutes of Form_Employee_Detail, or
Form_Invoice_Detail, or Form_Transaction_Detail, etc. I think you get theidea.

Any help would be greatly appreciated! Thanks!

John A. Prejean
jo**@gcit.net

Nov 20 '05 #4

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

Similar topics

4
by: Paradox | last post by:
Hey, I'm trying to figure out what situations call for the use of a derived form control such as: public class myListBox : System.Windows.Forms.ListBox and what situations call for the use...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
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: JC Voon | last post by:
Hi: My base form has a button, when click it will call MessageBox.Show( "Base form" ). I inherite a child form from the base and assign a button click event to the same button which will call...
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: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
2
by: Steve Teeples | last post by:
I have a simple form with a panel that is docked in the base form. The panel has three controls - two buttons and one treeview. I use "Inherited Form" when creating a second form derived from...
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...
6
by: Arkadiusz Smolak | last post by:
Hi, I need a help. I have form inherited from other form. The base form implementation is placed in other assembly. I try to open my inherited form in designer but visual studio throws an...
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:
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...
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...
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
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
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...

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.