Creating a single instance of a user control

Joined
Dec 5, 2007
Messages
2
Reaction score
0
Hi,

I have a user control. The user control is used in two different forms. Everytime i drag and drop the user control on the form, a new instance is created. But i want only a single instance to be used even when it is dragged and dropped in another form.
For Eg:
My user control contains a text box. This is added in two different forms, Form1 and Form2 at design time. When i run the program, the value entered in the text box in the usercontrol added in Form1 should be reflected in the user control in Form2. Form2 should use the same instance that Form1 uses. Can i use the User control as a static class?....Can anyone help me on this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top