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

Copy control question

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
5 1437
* "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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Chad Richardson | last post by:
I have not used the copy objects wizard that much. I used it today to copy 4 views from my dev box to production. It copied the views, but also wiped out my data in all the tables that the views...
3
by: Daniel | last post by:
Hi everyone, Does anyone know which control allows user to copy any data(text/non-text) from external source and paste in the X control. The X control will display everything just like the copied...
22
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...
1
by: raniyesudas | last post by:
In our project we have to use pop up menu to cut,copy,paste items to linked list. the items of the list are displayed in the list control.Hence by clicking on the item in the list control we should...
1
by: raniyesudas | last post by:
In our project we have to use pop up menu to cut,copy,paste items to linked list. the items of the list are displayed in the list control.Hence by clicking on the item in the list control we should...
17
by: Steve | last post by:
I'm trying to code cut, copy, and paste in vb 2005 so that when the user clicks on a toolbar button, the cut/copy/paste will work with whatever textbox the cursor is current located in (I have...
1
by: fl | last post by:
Hi, I browse through C++ primer. I have a question about the calling of copy constructor in the example of that book. Below, "item" is an associate container. In main func, there is a call of...
9
by: AWW | last post by:
Running XP - Visual Studio 2005 - VB Want to have duplicate projects - one safe and stable - other for experimenting Can't fine easy way to make duplicate project. Stupid question? or stupid ME?...
8
by: jh | last post by:
I'd like to copy/paste into a listbox during runtime. I can do this for a textbox but can't figure out how to accomplish this for a listbox. Any help? Thanks.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.