V
Vincent Finn
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;
}
}
}
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;
}
}
}