i'm trying to add a custom control to my project. after i compile i can see it in my toolbox but when i add it VS gives me this error:
---------------------------
Microsoft Visual Studio
---------------------------
Failed to load toolbox item 'myPanel'. It will be removed from the toolbox.
---------------------------
OK
---------------------------
my code for the panel
1 2 3 4 5 6 7 8 9 10 11 12
#pragma once
usingnamespace System;
usingnamespace System::Windows::Forms;
public ref class myPanel : public Panel {
public:
myPanel() : Panel() {
SetStyle(ControlStyles::DoubleBuffer, true);
SetStyle(ControlStyles::UserPaint, true);
SetStyle(ControlStyles::AllPaintingInWmPaint, true);
};
};
if i manually edit the code and run the program, then the panel works just fine.