Hi,
Is it possible (w/o generating a gazillion errors) to copy a form in VS
2005 so that it can be modified and reused. In other words, I have a form,
alot of which I wish to use in a different form. An no, I don't want to
inherit it. I just want to steal the layout and add and remove a few other
pieces. Any easy way to do this?
--
Terry 9 4195
I am not sure if this is what you mean, but you can drag and drop several
controls at once from a form in one VS session to a form in another VS
session. I would guess that you can copy and paste too, but I always drag
and drop. And, of course, you can copy and paste the associated code (but
that's a separate operation).
Bob
"Terry" <Te****@nospam.nospamwrote in message
news:A6**********************************@microsof t.com...
Hi,
Is it possible (w/o generating a gazillion errors) to copy a form in VS
2005 so that it can be modified and reused. In other words, I have a
form,
alot of which I wish to use in a different form. An no, I don't want to
inherit it. I just want to steal the layout and add and remove a few
other
pieces. Any easy way to do this?
--
Terry
That would be waste of time as everytime you do that the controls will take
default name like textbox1, button1, button2, and if you copy and paste the
code behind it wont recognise objects associated.
"eBob.com" <fa******@totallybogus.comwrote in message
news:ue**************@TK2MSFTNGP02.phx.gbl...
>I am not sure if this is what you mean, but you can drag and drop several controls at once from a form in one VS session to a form in another VS session. I would guess that you can copy and paste too, but I always drag and drop. And, of course, you can copy and paste the associated code (but that's a separate operation).
Bob
"Terry" <Te****@nospam.nospamwrote in message
news:A6**********************************@microsof t.com...
>Hi, Is it possible (w/o generating a gazillion errors) to copy a form in VS 2005 so that it can be modified and reused. In other words, I have a form, alot of which I wish to use in a different form. An no, I don't want to inherit it. I just want to steal the layout and add and remove a few other pieces. Any easy way to do this?
-- Terry
I'm pretty sure that what I did before was copy the files making up the form
to new files in the same directory. You can then add them to your project
with "add exisiting...". You will need to change the class names in the
files added, but it seemed painless to me.
"Terry" wrote:
Hi,
Is it possible (w/o generating a gazillion errors) to copy a form in VS
2005 so that it can be modified and reused. In other words, I have a form,
alot of which I wish to use in a different form. An no, I don't want to
inherit it. I just want to steal the layout and add and remove a few other
pieces. Any easy way to do this?
--
Terry
Terry,
For controls, don't Copy them, Cut them and Past them back. I mostly make a
dummy form copied outside the designer to do that from, which gives me a
more secure idea.
Cor
Select the form in Solution Explorer, right-click and hit Copy. Then, select
the project in Solution Explorer, right-click and hit Paste. Before opening
the newly created copy, hit View Code in Solution Explorer and rename the
class.
That's it.
"Terry" <Te****@nospam.nospamwrote in message
news:A6**********************************@microsof t.com...
Hi,
Is it possible (w/o generating a gazillion errors) to copy a form in VS
2005 so that it can be modified and reused. In other words, I have a
form,
alot of which I wish to use in a different form. An no, I don't want to
inherit it. I just want to steal the layout and add and remove a few
other
pieces. Any easy way to do this?
--
Terry
Ok, this *ALMOST* did it! One important step you left out - exclude the
original form from the project and then open the code behind and rename the
class. Else, it gets renamed in both forms, leaving you with the same
problem of 2 classes with the same name in the project. I had tried all the
of the methods mentioned in the thread, this seems the best if you want to
keep some of the code behind, data bindings etc.
Thanks,
--
Terry
"CMM" wrote:
Select the form in Solution Explorer, right-click and hit Copy. Then, select
the project in Solution Explorer, right-click and hit Paste. Before opening
the newly created copy, hit View Code in Solution Explorer and rename the
class.
That's it.
"Terry" <Te****@nospam.nospamwrote in message
news:A6**********************************@microsof t.com...
Hi,
Is it possible (w/o generating a gazillion errors) to copy a form in VS
2005 so that it can be modified and reused. In other words, I have a
form,
alot of which I wish to use in a different form. An no, I don't want to
inherit it. I just want to steal the layout and add and remove a few
other
pieces. Any easy way to do this?
--
Terry
This doesn't happen (to me) if I just simply rename the class directly in
the code editor (as I described). DON'T do a Refactor! Symbolic Rename...
because, yeah, that will do what you describe.
"Terry" <Te****@nospam.nospamwrote in message
news:D1**********************************@microsof t.com...
Ok, this *ALMOST* did it! One important step you left out - exclude the
original form from the project and then open the code behind and rename
the
class. Else, it gets renamed in both forms, leaving you with the same
problem of 2 classes with the same name in the project. I had tried all
the
of the methods mentioned in the thread, this seems the best if you want to
keep some of the code behind, data bindings etc.
Thanks,
--
Terry
"CMM" wrote:
>Select the form in Solution Explorer, right-click and hit Copy. Then, select the project in Solution Explorer, right-click and hit Paste. Before opening the newly created copy, hit View Code in Solution Explorer and rename the class. That's it.
"Terry" <Te****@nospam.nospamwrote in message news:A6**********************************@microso ft.com...
Hi,
Is it possible (w/o generating a gazillion errors) to copy a form in
VS
2005 so that it can be modified and reused. In other words, I have a
form,
alot of which I wish to use in a different form. An no, I don't want
to
inherit it. I just want to steal the layout and add and remove a few
other
pieces. Any easy way to do this?
--
Terry
Ok, got it. You edited the name as opposed to right clicking and 'renameing'
the class name.
Thanks again,
--
Terry
"CMM" wrote:
This doesn't happen (to me) if I just simply rename the class directly in
the code editor (as I described). DON'T do a Refactor! Symbolic Rename...
because, yeah, that will do what you describe.
"Terry" <Te****@nospam.nospamwrote in message
news:D1**********************************@microsof t.com...
Ok, this *ALMOST* did it! One important step you left out - exclude the
original form from the project and then open the code behind and rename
the
class. Else, it gets renamed in both forms, leaving you with the same
problem of 2 classes with the same name in the project. I had tried all
the
of the methods mentioned in the thread, this seems the best if you want to
keep some of the code behind, data bindings etc.
Thanks,
--
Terry
"CMM" wrote:
Select the form in Solution Explorer, right-click and hit Copy. Then,
select
the project in Solution Explorer, right-click and hit Paste. Before
opening
the newly created copy, hit View Code in Solution Explorer and rename the
class.
That's it.
"Terry" <Te****@nospam.nospamwrote in message
news:A6**********************************@microsof t.com...
Hi,
Is it possible (w/o generating a gazillion errors) to copy a form in
VS
2005 so that it can be modified and reused. In other words, I have a
form,
alot of which I wish to use in a different form. An no, I don't want
to
inherit it. I just want to steal the layout and add and remove a few
other
pieces. Any easy way to do this?
--
Terry
Yup. Edit the name directly. The beauty of it is that all the code behind
(partial classes) get renamed too. You only need to do a full "refactor" if
that's... well.... if that's what you want to do. :)
So the steps are:
Select the form in Solution Explorer, right-click and hit Copy. Then, select
the project in Solution Explorer, right-click and hit Paste. Before opening
the newly created form, hit View Code in Solution Explorer and rename the
class *directly* in the code editor (DON'T do right-click->rename). That's
it.
P.S.
This doesn't work as elegantly for webforms (though the steps are similar).
But, then the ASP.NET IDE Designer team have never really done a great job
with anything IMHO.
"Terry" <Te****@nospam.nospamwrote in message
news:5B**********************************@microsof t.com...
Ok, got it. You edited the name as opposed to right clicking and
'renameing'
the class name.
Thanks again,
--
Terry
"CMM" wrote:
>This doesn't happen (to me) if I just simply rename the class directly in the code editor (as I described). DON'T do a Refactor! Symbolic Rename... because, yeah, that will do what you describe.
"Terry" <Te****@nospam.nospamwrote in message news:D1**********************************@microso ft.com...
Ok, this *ALMOST* did it! One important step you left out - exclude
the
original form from the project and then open the code behind and rename
the
class. Else, it gets renamed in both forms, leaving you with the same
problem of 2 classes with the same name in the project. I had tried
all
the
of the methods mentioned in the thread, this seems the best if you want
to
keep some of the code behind, data bindings etc.
Thanks,
--
Terry
"CMM" wrote:
Select the form in Solution Explorer, right-click and hit Copy. Then, select the project in Solution Explorer, right-click and hit Paste. Before opening the newly created copy, hit View Code in Solution Explorer and rename the class. That's it.
"Terry" <Te****@nospam.nospamwrote in message news:A6**********************************@microso ft.com...
Hi,
Is it possible (w/o generating a gazillion errors) to copy a form
in
VS
2005 so that it can be modified and reused. In other words, I have
a
form,
alot of which I wish to use in a different form. An no, I don't
want
to
inherit it. I just want to steal the layout and add and remove a
few
other
pieces. Any easy way to do this?
--
Terry This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mark |
last post by:
I have a project management database and it has a form called Estimator that
calculates the cost of about 10 parts to a project. You can change parameters,
click a Calculate button and all the...
|
by: Woody Splawn |
last post by:
I have a number of fields on a form in a certain solution. In another
solution with a similar form I need to have these same fields. Do I need to
create them again from scratch or will it work ok...
|
by: Woody Splawn |
last post by:
I am somewhat new to VS.net in general. As a result I am prone to make
mistakes. When adding some new feature to a a form it would be nice if I
could back it up before trying something that might...
|
by: Woody Splawn |
last post by:
I seem to remember that you can copy a control, like a textbox AND any code
associated with it to another form. Is this true. If so, how? When I
select a textbox, for example in form and, copy...
|
by: kirschpe |
last post by:
I developed an application using visual studio 2003. Now I want to make a
similar application without having to redesign similar forms. Is there a way
to copy and paste windows forms across...
|
by: Mark |
last post by:
Good morning.
I recently made some changes to my Access project, and I introduced
some problems that I could not resolve. So I deleted the forms that I had
altered and saved the project. Then I...
|
by: Benson |
last post by:
Since there are many similar programs worked out, I want to copy a similar
program (alreay work under form inheritance) to a new one so that I can
change the new one quicker.
It is not ok to copy...
|
by: JD |
last post by:
Hi,
My associate has written a copy constructor for a class. Now I need to add
an operator = to the class. Is there a way to do it without change her code
(copy constructor) at all? Your help...
|
by: Dijkstra |
last post by:
Hi folks!
First, this is the code I'm using to expose the problem:
------------------------------------------------------------------
#include <functional>
#include <string>
#include...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: 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,...
|
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...
| |