By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,552 Members | 905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,552 IT Pros & Developers. It's quick & easy.

Copy control question

P: n/a
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 it and paste it to another
form, the control shows up but not any code in any of it's events.

Is my memory wrong?

Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
* "Woody Splawn" <wo***@splawns.com> scripsit:
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 it and paste it to another
form, the control shows up but not any code in any of it's events.


AFAIS this doesn't work.

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

P: n/a
Hi Woody,

Thank you for using MSDN newsgroup.

I agree with Herfried's suggestion.
Based on my experience, you can copy a control but NOT the event handler
function.

Some properties of controls will be copied. e.g, for TextBox , when you set
the Text property of the textbox in the property page, and you copy the
textbox to another form the text property will also be copied.

If you have any concern on this issue ,please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #3

P: n/a
I seem to remember some subtle difference with regard to copy, cut and
delete, that one of them allowed you to transfer not only the control but
the code behind it. However, I recognized that my memory is not what it
could be. Thank you for responding.

Nov 20 '05 #4

P: n/a
Hi Woody,

As I said in my last post, the copy-paste or cut-paste will transfer some
properties of a control( e.g. the text property of textbox) but not all
(e.g. the Databings-Text property).

If you want to make another form reuse the control on the form. You may try
to use the Visual Inherited.
You can inherited a form from the original one.

Here is helpful link, you may take a look.
Walkthrough: Demonstrating Visual Inheritance
http://msdn.microsoft.com/library/de...us/vbcon/html/
vbwlkwalkthroughdemonstratingvisualinheritance.asp

If you have any concern on this issue ,please post here.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #5

P: n/a
Hi Woody.

Did my answer help you?
if you have any concern on this issue,please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.