L
Linus Rörstad
Hi!
I have a problem creating a custom control for cf 1.0. To start I have 3
classes which looks something like this:
public class ControlClass: System.Windows.Form.Control
{
ControlClassCollection items = new ControlClassCollection();
public ControlClassCollection Items
{
get
{
return items;
}
}
protected override void OnPaint(PaintEventArgs e)
{
//draw some stuff
}
}
public class ControlClassCollection: System.Collections.CollectionBase
{
public Add(ControlClassItem classitem)
{
List.Add(classitem);
}
public ControlClassItem this[int index]
{
get
{
ControlClassItem item = (ControlClassItem)List[index];
return item;
}
set
{
List[index] = (ControlClassItem)value;
}
}
}
public class ControlClassItem
{
//some properties and varibles
}
They are all in seperated files.
This works fine when I compile it and I get it to draw when I add the
control to a form and so on. I can go into the Items property and add a
ControlClassItem object. This is all fine when draging and setting the
values of the control. But when I go into the code view there's no
ControlClassItem objects. Do ControlClassItem need to inherit from
System.Windows.Form.Control? If it does how do I hide it from being visible
in design view?
One thing that might be causing this problem is that I'm using SourceSafe
and therefore I will not have the dlls under Microsoft Visual Studio .NET
2003\CompactFrameworkSDK\v1.0.5000\Windows CE.
Anyone got a clue what seems to be the problem?
/Linus
I have a problem creating a custom control for cf 1.0. To start I have 3
classes which looks something like this:
public class ControlClass: System.Windows.Form.Control
{
ControlClassCollection items = new ControlClassCollection();
public ControlClassCollection Items
{
get
{
return items;
}
}
protected override void OnPaint(PaintEventArgs e)
{
//draw some stuff
}
}
public class ControlClassCollection: System.Collections.CollectionBase
{
public Add(ControlClassItem classitem)
{
List.Add(classitem);
}
public ControlClassItem this[int index]
{
get
{
ControlClassItem item = (ControlClassItem)List[index];
return item;
}
set
{
List[index] = (ControlClassItem)value;
}
}
}
public class ControlClassItem
{
//some properties and varibles
}
They are all in seperated files.
This works fine when I compile it and I get it to draw when I add the
control to a form and so on. I can go into the Items property and add a
ControlClassItem object. This is all fine when draging and setting the
values of the control. But when I go into the code view there's no
ControlClassItem objects. Do ControlClassItem need to inherit from
System.Windows.Form.Control? If it does how do I hide it from being visible
in design view?
One thing that might be causing this problem is that I'm using SourceSafe
and therefore I will not have the dlls under Microsoft Visual Studio .NET
2003\CompactFrameworkSDK\v1.0.5000\Windows CE.
Anyone got a clue what seems to be the problem?
/Linus