I have a design time problem when I inherit a UserControl
in Smart Device (Windows CE) solution of Visual studio 2008.
Assume that I have a class like this:
public class MyLabel:Label
{
//Do nothing at all
}
When I put MyLabel
in a Form, it doesn't display its text in design time, but at run-time it's working properly. So the problem is Visual Studio Label is working correctly but if I just inherit from it, it doesn't display its text in design time.
I have read some articles in MSDN like this link Creating and Migrating Smart Device Custom Controls by Using Visual Studio 2005 and other websites about how to design a UserControl
in Smart Device solution but it was too perfect and had a lot of code in it that confused me. I just want MyLabel
to show its text properly in design time, I don't want a perfect UserControl
. So if you have experienced my problem please share your solution.
It's working for me. Is it possible there is more logic in your MyLabel class that you've excluded for brevity that is causing the problem?
Here are the steps I followed:
Sometimes you have to add an XMTA file to help the designer, but I don't think this is one of those cases.
If you're trying to do your own drawing then that is something you'll have problems with as mentioned by the comment responses to your question.