Re: array of objects in a User Control
From: Marina (someone_at_nospam.com)
Date: 10/29/04
- Next message: Johnny van Cadsand: "Re: Inheritance / file locations"
- Previous message: Marina: "Re: Inheritance / file locations"
- In reply to: Vincent Finn: "array of objects in a User Control"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 29 Oct 2004 14:59:57 -0400
I dont' think the designer can serialize it to the array very well, because
it would have to constantly be changing its size. I have done this with
stringcollections, and that works well.
"Vincent Finn" <1@2.com> wrote in message
news:36n4o0tsa1fts3452npg1489cblrekesth@4ax.com...
> Hi,
>
> I am writing a Control (in C#) and I want to give the user access to
> an array of items in it.
> If I make a property that returns the array it doesn't work properly
> in the designer.
>
> The control properties in design mode show my propery
> I can select it
> that brings up a window that allows me to add new items and set their
> properties
> This seems to work and the new items are displayed
> As soon as I compile they vanish.
>
> The array created in the property editor seems to be loaded into
> memory but not saved in the .cs file
>
> I can use the property fine in my code it is just in the property
> window I can't.
>
> Here is the definitions I am using, nothing special about them
>
> Anyone any idea what I am doing wrong?
>
> Vin
>
> /////////////////////////////////////////////////////////
>
> // in the Control
> private Test[] m_aTests;
> public Test[] Tests
> {
> get
> {
> return m_aTests;
> }
> set
> {
> m_aTests = value;
> }
> }
>
> // the class Test
> public class Test
> {
> private int m_i;
> public Test()
> {
> }
> public int i
> {
> get
> {
> return m_i;
> }
> set
> {
> m_i = value;
> }
> }
> }
>
- Next message: Johnny van Cadsand: "Re: Inheritance / file locations"
- Previous message: Marina: "Re: Inheritance / file locations"
- In reply to: Vincent Finn: "array of objects in a User Control"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|