|
-
Aug 29th, 2006, 12:58 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] User Controls dont copy, when Form copied into another project
I have a Form with some user controls on it.
When the form is copied into another project, the user controls don't come with it.
I get picture boxes instead.
My current form has a user control frame, and it contains some user control buttons.
None of them copy across properly.
But even on my simpler Forms, with no frame, just user control buttons, I get the same problem.
(I have previously included the user controls into the target project)
If there is trick to it, I would appreciate hearing about it.
Thanks,
Last edited by RobCrombie; Aug 29th, 2006 at 01:07 PM.
Rob C
-
Aug 29th, 2006, 01:20 PM
#2
Re: User Controls dont copy, when Form copied into another project
how are you copying the form?
if you just copy the .frm file then it should work fine
-
Aug 29th, 2006, 01:27 PM
#3
Thread Starter
Fanatic Member
Re: User Controls dont copy, when Form copied into another project
I was copying the frm and the frx files
-
Aug 29th, 2006, 01:37 PM
#4
Thread Starter
Fanatic Member
Re: User Controls dont copy, when Form copied into another project
Here is a link to the button user control -
isButton
It is a great control and is worth checking out.
To replicate my problem -
Create a new project, and include the user control into the project.
Then go to the other folder (where you extracted the example above), and copy the smaller form (frmDefaultCancelProps) into your new project.
There will be an error log, and the button will be replaced with an empty picture box.
-
Aug 29th, 2006, 01:52 PM
#5
Re: User Controls dont copy, when Form copied into another project
you have to ensure that the new project already has a reference to the component before you add the form
Ctrl+T - check the appropriate one(s) - then add your form
-
Aug 29th, 2006, 02:02 PM
#6
Thread Starter
Fanatic Member
Re: User Controls dont copy, when Form copied into another project
I already have the ctl files included in the project as user controls (prior to me attempting to add the copied form).
Do you mean I should have a reference as well ?
I looked in the original project (which had the original form with the controls working on it). I cannot see any reference to the User Controls, in the 'Project References' or in the 'Project Components' menus.
They are in the Toolbox of both projects
-
Aug 29th, 2006, 02:13 PM
#7
Re: User Controls dont copy, when Form copied into another project
Which user control are you using? you made that control or downloaded it from somewhere?
-
Aug 29th, 2006, 02:23 PM
#8
Thread Starter
Fanatic Member
Re: User Controls dont copy, when Form copied into another project
It came from PSC
isButton
-
Aug 29th, 2006, 03:41 PM
#9
Re: User Controls dont copy, when Form copied into another project
frmDefaultCancelProps references isButtonTest.isButton - isButtonTest is the library (the Project Name) and isButton is the class.
If you add the user control to a new project the Library changes. It would be something like Project1.isButton
2 choices
1) change the name of your project to isButtonTest
2) change all occurrences of isButtonTest in the frm file (using notepad) to the name of the new project before adding the form to the project.
Last edited by brucevde; Aug 29th, 2006 at 03:50 PM.
-
Aug 29th, 2006, 04:00 PM
#10
Re: User Controls dont copy, when Form copied into another project
 Originally Posted by brucevde
2) change all occurrences of isButtonTest in the frm file (using notepad) to the name of the new project before adding the form to the project.
Nice Bruce , 1 question, is there any way to produce the OCX version of the usercontrol having that? the author says its in his homepage but it isnt.
-
Aug 29th, 2006, 04:07 PM
#11
Re: User Controls dont copy, when Form copied into another project
is there any way to produce the OCX version of the usercontrol having that?
Start a new ActiveX Control project.
Remove the default user control that is automatically added to the project.
Add the isButton user control.
Change the Project name to whatever you want.
Change the isButton.Public property to True.
Compile.
-
Aug 29th, 2006, 04:08 PM
#12
Thread Starter
Fanatic Member
Re: User Controls dont copy, when Form copied into another project
B R I L L I A N T
That was the problem, and a perfect solution.
Many thanks, you have saved me many hours of recreating a form that had a full size user control frame, filled with many isButtons and VB's intrinsic controls.
I will sing about you round the camp fires for years to come.
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
|