Label Class not showing in the toolbox after modification

Abdul Hayee

Member
Joined
Mar 31, 2020
Messages
24
Programming Experience
Beginner
Dear All
I am writing a code and i define a class for label. Pictures are as follows of Class Display Control, HMI Display and Toolbox
DisplayControl Class.png


Front panel.png


toolbox.png


everything was working fine. Then i made some changes in that class (DisplayControl) and delete one of Display Control in Design Form (as shown in the picture). But now on Toolbox is neither showing this label and code when built/compile is giving Error.
How to again show this label in toolbox and execute the whole program?

Hope you all get my point what i am trying to say

Thanks
 
If you have any custom controls or components declared in a project in the current solution then they will be displayed at the top of the Toolbox automatically after a successful build. If your build is failing then the item will not be displayed. You need to fix any errors and at least build that project to get the item to display.

If you are adding that item to the Toolbox for other solutions as well then you need to right-click the appropriate section of the Toolbox and choose the Select Toolbox Items option, then browse to the compiled DLL file and select the item explicitly. Rather than selecting the DLL in its project output folder, you should have a location on your system dedicated to compiled libraries, copy the DLL there and select it there too. That way, it won't go missing. You just have to update the DLL in that location when you make changes to the code and build it again.
 
If you have any custom controls or components declared in a project in the current solution then they will be displayed at the top of the Toolbox automatically after a successful build. If your build is failing then the item will not be displayed. You need to fix any errors and at least build that project to get the item to display.
You are right. i am declaring in a current solution and it was displaying on the top of toolbox. But now after some changes it is not showing in toolbox and also giving error

Error.png


i undo the changes but no effect. it is giving error when compile and run

code have only this issue, remaining code have no issue.
suggest some solution
 
Does the project containing the control build? Try building just that project and not the whole solution. If that project won't build then you have to fix that issue first.
 
what i done is delete all the DisplayControl label on Design Form. then build the whole project, it compiled without any error then i again add the DisplayControl Label. Now they added and compiled witout any error
 
Welcome to the flakiness of the WinForms Designer. At least your were able to recover. There's been cases in the past where things were so utterly broken that the only recourse is to start a new solution. After the third complete rewrite, I stopped using the designer and just create my forms and controls by hand. Besides, coding by hand let's me actually use inheritance unlike the WinForms Designer.
 
Besides, coding by hand let's me actually use inheritance unlike the WinForms Designer.
Did you try adding new Inherited Form and use Inheritance Picker?
 
I don't recall the Inheritance Picker existing back in VS2005.
 
Back
Top Bottom