|
-
Mar 31st, 2015, 08:56 AM
#1
Thread Starter
Fanatic Member
Copy all properties from Form to other Form
Hi
What way to copy /clone all properties from a form to other form in same project
tia
-
Mar 31st, 2015, 09:23 AM
#2
Re: Copy all properties from Form to other Form
Not sure what you are trying to do.
In the IDE ou can make a copy of the form by saving it then renaming it and save as a different filename then add the original to the project.
At run time you can launch a clone of the form by creating a new instance of it
Code:
Dim MyNewForm as Form
Set MyNewForm=New MyExistingForm
MyNewForm.Show
-
Mar 31st, 2015, 09:55 AM
#3
Re: Copy all properties from Form to other Form
Not really a "clone" as such but a new instance of the same Form class. People don't always realize a VB6 Form is both a class and a predeclared instance with the same name assigned to both.
-
Mar 31st, 2015, 10:22 AM
#4
Re: Copy all properties from Form to other Form
Well you can't copy all properties otherwise you will have naming conflicts
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Mar 31st, 2015, 01:19 PM
#5
Re: Copy all properties from Form to other Form
 Originally Posted by jmsrickland
Well you can't copy all properties otherwise you will have naming conflicts
If that were true you couldn't have Command1 on more than one form...which you can!
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
-
Mar 31st, 2015, 01:27 PM
#6
Re: Copy all properties from Form to other Form
JMS-----Did you try what DM said? I do it all the time in the IDE....as a matter of a fact, I ALSO create a NEW form, copy-paste any or all of the controls to it from the original form, AND IF I WANT, I copy/paste the associated code as well (making changes a necessary for the 2nd form name vice the original.
I also copy a form using windows explorer from one project to another (brings in all contols and code, of course).
-
Mar 31st, 2015, 01:57 PM
#7
Re: Copy all properties from Form to other Form
The question is Copy all properties from Form to other Form so I assume OP means the properties of the Form which includes the name of the Form
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Mar 31st, 2015, 02:06 PM
#8
Re: Copy all properties from Form to other Form
A S S U M E. I didn't make THAT assumption (the name of the form)! 
OP....you satisfied with DM's response(s)?
Sammi
-
Mar 31st, 2015, 02:06 PM
#9
Re: Copy all properties from Form to other Form
Well the name of course must be different as there can not be two with the same name plus there would be no point in having the second form anyway if it had the same name there would be no way to identify it from the other one assuming of course the IDE would let you do it in the first place.
In any case it is hard to say for sure what the OP is really wanting to do, maybe the question has been answered and maybe not.
-
Mar 31st, 2015, 02:52 PM
#10
Re: Copy all properties from Form to other Form
 Originally Posted by SamOscarBrown
A S S U M E. I didn't make THAT assumption (the name of the form)!
OP....you satisfied with DM's response(s)?
Sammi
Why not? Name is a property of a Form but Command1 is not a property
If the OP means Form properties then that includes Name but if OP means child windows of a Form then that includes Command1.
Depends on what OP really means
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Mar 31st, 2015, 02:59 PM
#11
Re: Copy all properties from Form to other Form
Because as DM points out, common sense would tell us (trying to help OP) that you can't have two identically named forms, like you can't have two buttons named Command1 on the same form.
-
Mar 31st, 2015, 03:00 PM
#12
Re: Copy all properties from Form to other Form
I assumed that the OP was asking about copying a form with all of its controls but we'll see, I suppose!
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
-
Mar 31st, 2015, 05:17 PM
#13
Re: Copy all properties from Form to other Form
I also assume that but my statement was based entirely on what OP said, common sense or not.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Mar 31st, 2015, 05:52 PM
#14
Re: Copy all properties from Form to other Form
 Originally Posted by jmsrickland
I also assume that but my statement was based entirely on what OP said, common sense or not.
Fair point. There's way too much second-guessing that goes on here due to poorly-asked questions...
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|