question

Wami007-9389 avatar image
0 Votes"
Wami007-9389 asked Wami007-9389 commented

Visual Studio C++/CLI Error : “Failed to load toolbox item, It will be removed from Toolbox”

Picture Linked to Title, I was try to:

Clean and Rebuild won't work
Project built in x86
Restart V.S doesn't work I just:
Created Form and userControl by Default name
Linked To Windows and Advanced to "main"
Added code in Form.cpp to fix Designer error and restart V.S
Try to Drag userControl but no luck ;(85484-screenshot-2021-04-08-021236.png


dotnet-csharpc++dotnet-runtimedotnet-standarddotnet-cli
· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Wami007-9389

I suggest you could try to create an instance of user control.

Suppose you have myusercontrol.cpp with same namespace in your project.
Add this code in you form where you want to use myusercontrol.

 MyUserControl ob = gcnew MyUserControl();
 this->Controls->Add(ob);
0 Votes 0 ·

Sir, If you want try it on your V.S but when i add this code to my MainForm, designer return error to me....

0 Votes 0 ·

@Wami007-9389


Could you please provide some steps and a code sample that help us reproduce the issue?

For more details about how to create a c++/cli User Control, I suggest you could refer to the link: https://stackoverflow.com/questions/61423056/creating-a-clr-user-control


0 Votes 0 ·
Show more comments

Sir, If you want try it on your V.S but when i add this code to my MainForm, designer return error to me....

0 Votes 0 ·

Maybe the User Control includes some code that cannot be executed on design stage, giving an exception. The DesignMode property can be used to exclude inappropriate code. Show some details about your user control and try to replicate the problem with a new User Control that does not include additional code.

0 Votes 0 ·

All codes is default after creating form and control i don't add any code but give error

0 Votes 0 ·

0 Answers