UserControl and List<int>

M

Monty

I have a Usercontrol with a public property List<int> Links

List <int> Links= new List<int>();
public List<int> LinkLabels
{
get { return Links; }
set { Links = value; }
}



Now when i put it on a dialog and open the properties dialog in design
mode i can click the (...) button and it opens up the add items to
collection dialog and i can add a few int(s) to the collection but
when i click ok and open it up again all entered values are gone

if i set a breakpoint at the set function then the value is empty

any help will be greatly appreciated

-Thanks
 
A

Alex Meleta

A better solution is to use an array or indexer of the values:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=885160&SiteID=1

WBR, Alex Meleta
Blog: http://devkids.blogspot.com


-----Original Message-----
From: Monty [mailto:[email protected]]
Posted At: Dienstag, 17. April 2007 21:44
Posted To: microsoft.public.dotnet.languages.csharp
Conversation: UserControl and List<int>
Subject: UserControl and List<int>

I have a Usercontrol with a public property List<int> Links

List <int> Links= new List<int>();
public List<int> LinkLabels
{
get { return Links; }
set { Links = value; }
}



Now when i put it on a dialog and open the properties dialog in design
mode i can click the (...) button and it opens up the add items to
collection dialog and i can add a few int(s) to the collection but
when i click ok and open it up again all entered values are gone

if i set a breakpoint at the set function then the value is empty

any help will be greatly appreciated

-Thanks
 

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