473,326 Members | 2,081 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,326 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 980
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...
2
by: Marijn | last post by:
Say i have an object that represents or holds a resource like an open file, a block of memory on the heap, or an openGL texture object. The constructor acquires the resource, and the destructor...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.