Adding custom controls to the Toolbox

O

ORC

This is my first custom control in C# (.NET) so sorry for my ignorance if
this question seems to have an obvious answer. I have made a custom control
that Inherites a TextBox. I want to add the control to the Toolbox in both
the "Normal" editor and the "Small devices" editor. How should I do that,
and is there anything I must include in my code in order to have it visible
in design mode or does the TextBox handle that?

Thank you for your help!
Ole
 
P

Peter Foot [MVP]

You need to build a design-time version of the dll which is built against
the full framework and the .NETCF designer libraries. There is an example
here by Alex Yakhnin http://www.intelliprog.com/articles/index.html
If your control derives from TextBox then you probably don't need to do any
custom drawing or similar. But you will need to go through the other steps
of adding the runtime assembly attribute, add attributes for the designer
and build against the System.CF.* dlls
You may wish to refer to the TextBoxEx code in the SDF since this derives
from TextBox and adds extra properties.
http://www.opennetcf.org/sourcebrow...oot/Source/OpenNETCF.Windows.Forms/TextBox.cs

Peter
 
O

ORC

Thanks!

Ole

Peter Foot said:
You need to build a design-time version of the dll which is built against
the full framework and the .NETCF designer libraries. There is an example
here by Alex Yakhnin http://www.intelliprog.com/articles/index.html
If your control derives from TextBox then you probably don't need to do any
custom drawing or similar. But you will need to go through the other steps
of adding the runtime assembly attribute, add attributes for the designer
and build against the System.CF.* dlls
You may wish to refer to the TextBoxEx code in the SDF since this derives
from TextBox and adds extra properties.
http://www.opennetcf.org/sourcebrow...oot/Source/OpenNETCF.Windows.Forms/TextBox.cs

Peter
 

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