How do I keep User Controls from losing Properties?

T

Tim Reed

Hi there,

1) I created a user control with a public label.
2) I place these a form and set each one's text property differently.
3) When I run (or rebuild) the project, the text property reverts back to
it's original value!

What am I doing wrong?

Thanks so much,
Tim
 
B

Bob Powell [MVP]

If you created the user-control in the same project as the solution that
hosts it this is probably a bad idea.

Try moving the user control to it's own solution and then follow the
instructions in Windows Forms Tips and tricks for how to debug a control.

If you've created the user control in it's own solution, try making sure
that the version number in ssemblyInfo.vb doesn't have any asterisks in. Set
the version number explicitly.

If none of these work and the properties you are talking about are
collections, see the DesignerSerializationVisibility attribute for details.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

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