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

how to make a second copy of a form

TM
I have a form that I would like to use, with a few small code and control
text changes, and was wondering if there was any way that I could somehow
save another cop of the form so I can just import it code and all.

Thanks

--
Tony


Nov 20 '05 #1
20 1612
"TM" <no********@nothing.com> wrote...
I have a form that I would like to use, with a few small code and control
text changes, and was wondering if there was any way that I could somehow
save another cop of the form so I can just import it code and all.


So far all I have been doing is renaming the form and then using Save As...
the original will still be on the drive. Then you just add an existing
form, select the first one and it's back.

Tom
Nov 20 '05 #2
"TM" <no********@nothing.com> schrieb
I have a form that I would like to use, with a few small code and
control text changes, and was wondering if there was any way that I
could somehow save another cop of the form so I can just import it
code and all.


Solution explorer: Select file, Ctrl+C, Ctrl+V
or Drag&Drop holding down the Ctrl key

Maybe it's even better to create two Forms and move the common code to a
common base Form.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
"Armin Zingler" <az*******@freenet.de> wrote in message
news:e6****************@TK2MSFTNGP09.phx.gbl...
"TM" <no********@nothing.com> schrieb
I have a form that I would like to use, with a few small code and
control text changes, and was wondering if there was any way that I
could somehow save another cop of the form so I can just import it
code and all.
Solution explorer: Select file, Ctrl+C, Ctrl+V
or Drag&Drop holding down the Ctrl key

Maybe it's even better to create two Forms and move the common code to

a common base Form.


I might be missing something here, but wouldn't it be simpler to inherit
the base form and apply changes rather than duplicate the code in
another file?

Luke.
Nov 20 '05 #4
"Luke Vogel" <pr**********@netscape.net> schrieb
"Armin Zingler" <az*******@freenet.de> wrote in message
news:e6****************@TK2MSFTNGP09.phx.gbl...
"TM" <no********@nothing.com> schrieb
I have a form that I would like to use, with a few small code
and control text changes, and was wondering if there was any way
that I could somehow save another cop of the form so I can just
import it code and all.


Solution explorer: Select file, Ctrl+C, Ctrl+V
or Drag&Drop holding down the Ctrl key

Maybe it's even better to create two Forms and move the common code
to

a
common base Form.


I might be missing something here, but wouldn't it be simpler to
inherit the base form and apply changes rather than duplicate the
code in another file?


If you want two Forms to inherit from one base form, you need even three
files (not necessarily but if you want to use the designer) - without having
duplicate code.
--
Armin

Nov 20 '05 #5
Not really possible in VB.NET, I assume you are conversant with other
langauges which use templates like C++

Regards - OHM

TM wrote:
I have a form that I would like to use, with a few small code and
control text changes, and was wondering if there was any way that I
could somehow save another cop of the form so I can just import it
code and all.

Thanks


Best Regards - OHMBest Regards - OHM On**********@BTInternet.Com
Nov 20 '05 #6
* "TM" <no********@nothing.com> scripsit:
I have a form that I would like to use, with a few small code and control
text changes, and was wondering if there was any way that I could somehow
save another cop of the form so I can just import it code and all.


Develop a common base form and inherit the 2 forms from this form.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
Cor
Herfried,

I think Armin Zingler did give the right answer.

Develop a common base form and inherit the 2 forms from this form.

This could be the intention but not the question.

I think with your answer should also be a sentence as

"Do you know how to do that?

You know only positive ment to keep our quality high.

:-)

Cor
Nov 20 '05 #8
* "Cor" <no*@non.com> scripsit:
I think Armin Zingler did give the right answer.

Develop a common base form and inherit the 2 forms from this form.


This could be the intention but not the question.


Yep. I know that. But I think it's the preferred way. I would not
create "copies" of one source file and make little modifications.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
Tony,
I would recommend the same as Luke & Herfried.

Define a base form with the common functionality then inherit each
specialized version from this common base.

A good place to learn about Inheritance is:
http://msdn.microsoft.com/library/de...ithObjects.asp

For samples of Visual Inheritance, which is used with forms:
http://msdn.microsoft.com/library/de...nheritance.asp

http://msdn.microsoft.com/library/de...l/vs0201gs.asp

Hope this helps
Jay

"TM" <no********@nothing.com> wrote in message
news:uH**************@TK2MSFTNGP09.phx.gbl...
I have a form that I would like to use, with a few small code and control
text changes, and was wondering if there was any way that I could somehow
save another cop of the form so I can just import it code and all.

Thanks

--
Tony

Nov 20 '05 #10
TM
Very interesting. Much for thought.

Thank you all

--
Tony

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Tony,
I would recommend the same as Luke & Herfried.

Define a base form with the common functionality then inherit each
specialized version from this common base.

A good place to learn about Inheritance is:
http://msdn.microsoft.com/library/de...ithObjects.asp
For samples of Visual Inheritance, which is used with forms:
http://msdn.microsoft.com/library/de...nheritance.asp
http://msdn.microsoft.com/library/de...l/vs0201gs.asp
Hope this helps
Jay

"TM" <no********@nothing.com> wrote in message
news:uH**************@TK2MSFTNGP09.phx.gbl...
I have a form that I would like to use, with a few small code and control text changes, and was wondering if there was any way that I could somehow save another cop of the form so I can just import it code and all.

Thanks

--
Tony


Nov 20 '05 #11
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
* "Cor" <no*@non.com> scripsit:
I think Armin Zingler did give the right answer.

Develop a common base form and inherit the 2 forms from this form.


This could be the intention but not the question.


Yep. I know that. But I think it's the preferred way. I would not
create "copies" of one source file and make little modifications.


That's what I'd have thought. Seems to me that one of the big
advantages of VB.NET and Object Oriented Programming is that of
inheritance, and in this case, visual inheritance lends itself
beautifully to "a few small code and control text changes".

I'm only a newbie myself, but my study of the subject points to
Herfried's answer as the better solution.

Luke.
Nov 20 '05 #12
* "Luke Vogel" <pr**********@netscape.net> scripsit:
I think Armin Zingler did give the right answer.

Develop a common base form and inherit the 2 forms from this form.

This could be the intention but not the question.


Yep. I know that. But I think it's the preferred way. I would not
create "copies" of one source file and make little modifications.


That's what I'd have thought. Seems to me that one of the big
advantages of VB.NET and Object Oriented Programming is that of
inheritance, and in this case, visual inheritance lends itself
beautifully to "a few small code and control text changes".

I'm only a newbie myself, but my study of the subject points to
Herfried's answer as the better solution.


Everybody with < 5 years of experience with .NET (me too) is a "newbie".

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #13
Cor
Hi Jay B,

I disagree (in this case not in general), please see my comments at Luke.
I would recommend the same as Luke & Herfried. This is what I disagree

Define a base form with the common functionality then inherit each
specialized version from this common base.

This is what I agree

Cor
Nov 20 '05 #14
Cor
Hi Luke
I have a form that I would like to use, with a few small code and control
text changes, and was wondering if there was any way that I could somehow
save another cop of the form so I can just import it code and all.

I disagree with you and all others who stated it is that inheritance is the
right answer for this.

If it is about a form with 6 panels on it, on some a tabpage on some a
slider, in a docked panel, than a menu on it, a statusbar, a datagrid with
as in the microsoft samples dataaccess on it, that only needs some changes
for another project and only needs some slight changes, I would not think
one minute about inheriting that form.

When we are talking about making first a nice base form with nice colors we
want to use, a standard statusbar, the fonts etc, I think I agree with you.

Just a thought,

Cor

Nov 20 '05 #15
If you think about it Cor, using an inherited form makes perfect sense for
some applications. However, I do agree with you that there is a case for
some functionality to allow template forms.

In fact forms inheritance can in some instances be annoying. This can happen
when you want the basic design but need to change some details of the
private members, its more akward really than being able to simply choose a
new form from a tamplate.

Thats what I think anyway.

OHM#

Cor wrote:
Hi Luke
I have a form that I would like to use, with a few small code and
control text changes, and was wondering if there was any way that I
could somehow save another cop of the form so I can just import it
code and all.

I disagree with you and all others who stated it is that inheritance
is the right answer for this.

If it is about a form with 6 panels on it, on some a tabpage on some a
slider, in a docked panel, than a menu on it, a statusbar, a datagrid
with as in the microsoft samples dataaccess on it, that only needs
some changes for another project and only needs some slight changes,
I would not think one minute about inheriting that form.

When we are talking about making first a nice base form with nice
colors we want to use, a standard statusbar, the fonts etc, I think I
agree with you.

Just a thought,

Cor


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #16
* "Cor" <no*@non.com> scripsit:
I have a form that I would like to use, with a few small code and control
text changes, and was wondering if there was any way that I could somehow
save another cop of the form so I can just import it code and all.


I disagree with you and all others who stated it is that inheritance is the
right answer for this.

If it is about a form with 6 panels on it, on some a tabpage on some a
slider, in a docked panel, than a menu on it, a statusbar, a datagrid with
as in the microsoft samples dataaccess on it, that only needs some changes
for another project and only needs some slight changes, I would not think
one minute about inheriting that form.


If it's in an other project and you don't wand to use a common class
library, that's the way to go.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #17
* "One Handed Man [ OHM ]" <te***************************@BTOpenworld.com> scripsit:
If you think about it Cor, using an inherited form makes perfect sense for
some applications. However, I do agree with you that there is a case for
some functionality to allow template forms.

In fact forms inheritance can in some instances be annoying. This can happen
when you want the basic design but need to change some details of the
private members, its more akward really than being able to simply choose a
new form from a tamplate.


That's why some people prefer to declare "private" variables as
'Protected' instead of 'Private'.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #18
Yes, I know how it works. But its a conscious effort to ensure they are
protected. It just can make life a little more complicated. Where sometimes,
you just want to copy the design and not worry about it.

OHM#'
Herfried K. Wagner [MVP] wrote:
* "One Handed Man [ OHM ]"
<te***************************@BTOpenworld.com> scripsit:
If you think about it Cor, using an inherited form makes perfect
sense for some applications. However, I do agree with you that there
is a case for some functionality to allow template forms.

In fact forms inheritance can in some instances be annoying. This
can happen when you want the basic design but need to change some
details of the private members, its more akward really than being
able to simply choose a new form from a tamplate.


That's why some people prefer to declare "private" variables as
'Protected' instead of 'Private'.


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #19
Cor,
for another project Is the key word here! The OP never really stated if its the same project or
a different project.

Obviously if its a different project it may be easier just to copy the form
into the second project as you suggest.

However if its the same project then inheritance, most of the time, is the
better method. However in your tab page example, it may be that each tab
page may be its own control, and each distinct form would simply reference a
single extended tab page class...

Hope this helps
Jay

"Cor" <no*@non.com> wrote in message
news:ei**************@TK2MSFTNGP09.phx.gbl... Hi Luke
I have a form that I would like to use, with a few small code and controltext changes, and was wondering if there was any way that I could somehowsave another cop of the form so I can just import it code and all.


I disagree with you and all others who stated it is that inheritance is

the right answer for this.

If it is about a form with 6 panels on it, on some a tabpage on some a
slider, in a docked panel, than a menu on it, a statusbar, a datagrid with
as in the microsoft samples dataaccess on it, that only needs some changes for another project and only needs some slight changes, I would not think
one minute about inheriting that form.

When we are talking about making first a nice base form with nice colors we want to use, a standard statusbar, the fonts etc, I think I agree with you.
Just a thought,

Cor

Nov 20 '05 #20
Cor
Hi Jayb B,

For me were the keyword this.
I have a form that I would like to use, with a few small code and control
text changes, and was wondering if there was any way that I could somehow
save another cop of the form so I can just import it code and all.


This you don't ask for a simple form with 5 controls on it.

If it had been:
I have a form, with few code and controls, and I was wondering
if............., we had fully agreed.

But lets make this OT, to much words for somethings were is so few
difference in idea's, we agree that it is not "always" but bassicly the
best approach.

Cor

Nov 20 '05 #21

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

Similar topics

3
by: Susan Bricker | last post by:
Greetings. I have three forms that are open at the same time. They are related and cascading. The first form (frmEventAdd) is the anchor. Each event can have many Trials. The second form is...
2
by: RD | last post by:
My application contains several Classes & Forms . From the Login form I will get the User ID and Password for the SqlConnection. I established the connection through another class and...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
28
by: Steven Bethard | last post by:
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions!...
13
by: Niyazi | last post by:
Hi I have a report that I have to run it monthly in my machine. My code in VB.NET and I access AS400 to get data, anaysie it and send into pre formated Excel sheet. The data consist of 9000...
5
by: tshad | last post by:
How do you easily make a copy of an arraylist? If you do: arrayList2 = arrayList1 You get a pointer so that if you clear arrayList2 (arrayList2.Clear) - arrayList1 is also cleared. I...
48
by: Nathan Sokalski | last post by:
Ever since I found out that they didn't give us a way to install both IE6 and IE7 on the same machine, I have been more frustrated and annoyed with Microsoft than I ever have been with any company...
18
by: active | last post by:
Console.WriteLine(String.Equals(s, s.Clone.ToString)) s is type string. This returns True. If Clone really made a new copy I'd expect False.
3
by: raylopez99 | last post by:
I suspect the answer to this question is that it's impossible, but how do I make the below code work, at the point where it breaks (marked below). See error CS0411 This is the complete code. ...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
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...

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.