473,785 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1449
* "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/
vbwlkwalkthroug hdemonstratingv isualinheritanc e.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
1301
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 are built around!!! In production!!!! Can someone provide me some insight into why this happened? Thanks, Chad
3
1337
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 object format wihout changing anything. So, what is the X control? Any ideas? guideline? thank you in advance. Best regards,
22
5100
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 mess things up. Also, there are times when a new form is enough like an old one that the best way to create the new report is to simply make a copy of the old one, rename the copy and add modifications. So the question is, how to backup or...
1
1837
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 be able to copy the item in the cell of list control and paste it into any cell. this should also make proper changes to the linked list too.
1
3400
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 be able to copy the item in the cell of list control and paste it into any cell. this should also make proper changes to the linked list too.
17
5130
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 about 20 textboxes on the form). Also to ensure that the button can't get used if the cursor isn't in a textbox field. And to ensure the contents of the clipboard are "text" contents that have been cut/copied from one of the textboxes on the form. ...
1
1332
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 add_item. From debug, I see add_item calls "Sales_item(const Sales_item &i)". My question is: why add_item calls the copy constructor. To you, it may be very easy. For a beginner like me, I don't know now. Could you give me an explanation about that?...
9
6502
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? Thanks.
8
15441
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
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10319
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10087
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.