Click here to Skip to main content
15,923,389 members
Home / Discussions / C#
   

C#

 
GeneralRe: Passing a Class as a method parameter? Pin
Judah Gabriel Himango6-Jul-06 9:29
sponsorJudah Gabriel Himango6-Jul-06 9:29 
GeneralRe: Passing a Class as a method parameter? Pin
Jun Du6-Jul-06 12:10
Jun Du6-Jul-06 12:10 
AnswerRe: Passing a Class as a method parameter? Pin
Jun Du6-Jul-06 9:05
Jun Du6-Jul-06 9:05 
Questionadding icon to systemtray Pin
Mridang Agarwalla6-Jul-06 7:41
Mridang Agarwalla6-Jul-06 7:41 
AnswerRe: adding icon to systemtray Pin
Stefan Troschuetz6-Jul-06 8:15
Stefan Troschuetz6-Jul-06 8:15 
GeneralRe: adding icon to systemtray Pin
Mridang Agarwalla6-Jul-06 17:15
Mridang Agarwalla6-Jul-06 17:15 
GeneralRe: adding icon to systemtray Pin
Stefan Troschuetz6-Jul-06 20:56
Stefan Troschuetz6-Jul-06 20:56 
QuestionCopying UserControl Variables to another instance of the UserControl [modified] Pin
TheBlindWatchmaker6-Jul-06 7:39
TheBlindWatchmaker6-Jul-06 7:39 
Greetings!

I was wondering if I could get some direction to get me started in implementing a "copy/paste" of the properties of a UserControl.

In my application, I have 10 instances of a particular UserControl. This UserControl has, say, 10 properties. I would like to be able to use the right-click menu that I have for this UserControl and be able to copy the "settings" of one instance to any other instance of the UserControl.

From what I've read on MSDN, I understand that I have to make the UserControl class Serializable and that the variables that I do not copied can be excluded using the [NonSerializable] attribute, thus so:

<br />
[Serializable]<br />
<br />
public class ctlMyControl : ctlBaseControl<br />
{<br />
int nNum1; // Copied<br />
float fNum2; // Copied<br />
<br />
[NonSerializable]<br />
float fNum3; // Not Copied<br />
<br />
// The rest of the code<br />
}



My question is how does one implement the actualy copy and paste?

What function(s) do I use to perform the copy and what function(s) do I use to paste?

Your help is appreciated!

Thanks!


-- modified at 13:39 Thursday 6th July, 2006
AnswerRe: Copying UserControl Variables to another instance of the UserControl Pin
Dustin Metzgar6-Jul-06 7:55
Dustin Metzgar6-Jul-06 7:55 
GeneralRe: Copying UserControl Variables to another instance of the UserControl Pin
TheBlindWatchmaker6-Jul-06 8:13
TheBlindWatchmaker6-Jul-06 8:13 
GeneralRe: Copying UserControl Variables to another instance of the UserControl Pin
Dustin Metzgar6-Jul-06 8:28
Dustin Metzgar6-Jul-06 8:28 
QuestionTransferring data from database to database Pin
Stephen Hurt6-Jul-06 6:27
Stephen Hurt6-Jul-06 6:27 
AnswerRe: Transferring data from database to database Pin
led mike6-Jul-06 6:40
led mike6-Jul-06 6:40 
AnswerRe: Transferring data from database to database Pin
BambooMoon6-Jul-06 7:09
BambooMoon6-Jul-06 7:09 
Questionif/else statement for command button; object reference not set to an instance error Pin
leckey6-Jul-06 6:15
leckey6-Jul-06 6:15 
AnswerRe: if/else statement for command button; object reference not set to an instance error Pin
Guffa6-Jul-06 6:21
Guffa6-Jul-06 6:21 
GeneralRe: if/else statement for command button; object reference not set to an instance error Pin
leckey6-Jul-06 7:08
leckey6-Jul-06 7:08 
GeneralRe: if/else statement for command button; object reference not set to an instance error Pin
Paul Conrad6-Jul-06 7:17
professionalPaul Conrad6-Jul-06 7:17 
GeneralRe: if/else statement for command button; object reference not set to an instance error [modified] Pin
leckey6-Jul-06 7:55
leckey6-Jul-06 7:55 
GeneralRe: if/else statement for command button; object reference not set to an instance error Pin
Paul Conrad6-Jul-06 8:00
professionalPaul Conrad6-Jul-06 8:00 
GeneralRe: if/else statement for command button; object reference not set to an instance error Pin
Paul Conrad6-Jul-06 8:04
professionalPaul Conrad6-Jul-06 8:04 
AnswerRe: if/else statement for command button; object reference not set to an instance error Pin
Guffa6-Jul-06 8:16
Guffa6-Jul-06 8:16 
GeneralRe: if/else statement for command button; object reference not set to an instance error Pin
leckey6-Jul-06 8:40
leckey6-Jul-06 8:40 
AnswerRe: if/else statement for command button; object reference not set to an instance error Pin
Paul Conrad6-Jul-06 6:59
professionalPaul Conrad6-Jul-06 6:59 
QuestionListView Item/Subitem backcolor solution Pin
Aaron Dilliard6-Jul-06 5:33
Aaron Dilliard6-Jul-06 5:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.