开发者

Adding a Customized Control To Designer View

In visual studio (Actually 2010, but I guess it goes for any previous version)

Whenever I use an extended control such as :

 public class MainForm : Form
 {

   ...

   class myListBox : ListBox
   {
     //My Desired behavior
   }
 }

I have the following error in designer view :

Could not find type 'AMC.Controls.AMCStockChart+XChart'. Please make s开发者_如何学Cure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.

Any workaround is appreciated.

PS : I do not want to create a user control, place it in a dll an all that stuff, this is way too much work for a little detail like that.


well if you want a workaround, you don't need to put your custom control in other assembly, as long as it is not an inner class of your form seems to work.

of course, you'll need to compile the current project before being able to use it through the designer.

This works for me:

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

    }

}

class MyListBox : ListBox
{

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜