473,408 Members | 2,444 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,408 software developers and data experts.

Copying A Control Not As A Reference

I have a Control that I want to copy as a copy of the Control, not a copy of
the reference to the original. My reason for doing this is because some of
the methods I would calling would prevent proper rendering afterwards. I
access the Control as a parameter of a function, as follows:

Private Function MyFunction(ByVal ctrl As Control) As String
'code that will make a copy of ctrl
'my function code
End Function

(NOTE: I am using VB.NET and .NET Framework 1.1) Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Jun 12 '06 #1
4 951
Nathan Sokalski wrote:
I have a Control that I want to copy as a copy of the Control, not a copy of
the reference to the original. My reason for doing this is because some of
the methods I would calling would prevent proper rendering afterwards. I
access the Control as a parameter of a function, as follows:

Private Function MyFunction(ByVal ctrl As Control) As String
'code that will make a copy of ctrl
'my function code
End Function

(NOTE: I am using VB.NET and .NET Framework 1.1) Thanks.

You have to pass the ctrl ByRef in order to be working with the one you
want to copy.

T
Jun 12 '06 #2
That does not help. Let me try explaining my problem differently with an
example:

Private Function MyFunction(ByVal ctrl As Control) As String
dim copyofctrl as Control

'copyofctrl=ctrl this will be replaced with code that will assign a
copy of ctrl to copyofctrl that points to a new instance of whatever type
ctrl was
'my function code
End Function

In the part of my code labeled "my function code" I want to be able to do
ANYTHING I WANT to the local variable copyofctrl without having any effect
on ctrl. Hopefully this clears up what I am trying to do.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"tomb" <to**@technetcenter.com> wrote in message
news:RV*******************@bignews8.bellsouth.net. ..
Nathan Sokalski wrote:
I have a Control that I want to copy as a copy of the Control, not a copy
of the reference to the original. My reason for doing this is because some
of the methods I would calling would prevent proper rendering afterwards.
I access the Control as a parameter of a function, as follows:

Private Function MyFunction(ByVal ctrl As Control) As String
'code that will make a copy of ctrl
'my function code
End Function

(NOTE: I am using VB.NET and .NET Framework 1.1) Thanks.

You have to pass the ctrl ByRef in order to be working with the one you
want to copy.

T

Jun 12 '06 #3
Nathan,

If a class is serializable you can almost forever copy something to
serialize the object first and than deserialize it again.

http://www.vb-tips.com/default.aspx?...c-61641f5c8d9d

I hope this helps,

Cor

"Nathan Sokalski" <nj********@hotmail.com> schreef in bericht
news:%2****************@TK2MSFTNGP02.phx.gbl...
I have a Control that I want to copy as a copy of the Control, not a copy
of the reference to the original. My reason for doing this is because some
of the methods I would calling would prevent proper rendering afterwards. I
access the Control as a parameter of a function, as follows:

Private Function MyFunction(ByVal ctrl As Control) As String
'code that will make a copy of ctrl
'my function code
End Function

(NOTE: I am using VB.NET and .NET Framework 1.1) Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Jun 12 '06 #4
"tomb" <to**@technetcenter.com> schrieb:
I have a Control that I want to copy as a copy of the Control, not a copy
of the reference to the original. My reason for doing this is because some
of the methods I would calling would prevent proper rendering afterwards.
I access the Control as a parameter of a function, as follows:

Private Function MyFunction(ByVal ctrl As Control) As String
'code that will make a copy of ctrl
'my function code
End Function

(NOTE: I am using VB.NET and .NET Framework 1.1) Thanks.


You have to pass the ctrl ByRef in order to be working with the one you
want to copy.


No, you should pass it 'ByVal' because 'Control' is already a reference
type.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jun 12 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore...
1
by: Jerry Harris | last post by:
Hello, After copying a database to a new computer, a header using the =Format$ stops working. Instead of displaying the field, the report prompts me to "Enter paramater value for Format$. Any...
8
by: Randy | last post by:
Hi, is it possible to show the progress of a big file being copied e.g. in a "progressbar"? I tried to use file.copy - but this seems to make no sense :-( Thanks in advance, Randy
5
by: Steve - DND | last post by:
Is there any way to easily deep copy an entire object? Maybe something with unsafe code to make a full and completely duplicated copy of an object with no reference ties to the original? I want...
3
by: Jeries Shahin | last post by:
Hi I am trying to copy files from a folder on a Novel machine, the folder is in the UMC format (i cannot map a network drive for some business reasons). Upon copying, it fires an IOException...
4
by: Nathan Sokalski | last post by:
I have a Control that I want to copy as a copy of the Control, not a copy of the reference to the original. My reason for doing this is because some of the methods I would calling would prevent...
19
by: Jeff | last post by:
....working with visualweb.net 2005 and vb. ....trying to simply copy the contents from a textbox to the clipboard. I've looked at a large number of places on line and they give me various...
4
by: =?Utf-8?B?Sm9uIEVsbGlz?= | last post by:
Hi All, I want to implement an 'generic' undo by placing a copy of a control in a stack using System.Collections.Generic.Stack. Basically this way I don't need to know if a user has edited text...
4
by: MAdcock | last post by:
Hi, I have created an excel program which creates 65 or more (nneds to be unlimited) customised letters for clients. The macro uses VLOOKUP to change the details within the letter and copies /...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
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...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.