I am probably facing a basic problem. I would like to create TimePickers as in this project link:
And I can see that Timepicker inside my toolbox.
But when I try to drag it to my panel I am facing with this error.
CodePudding user response:
To explain this process more clearly:
Edit Opulos/Core/UI/TimePicker.cs
Add the below codes:
public TimePicker() :this(3, true, true, true, true) {
}
Then rebuild the program, you could find it in the toolbox.
Output:
Thanks to jimi's explanation:
Pass default values or configure it to generate a different pre-defined behavior when the class is created via ToolBox.
Keep in mind that those classes are not built with the ToolBox in mind (no reference to ToolBox behavior is specified anywhere), it looks like all are meant to be instantiated in code.
I.e., you may have the same problem somewhere else.
You should know what to do (though decorating the public Control classes with appropriate [ToolboxItem], [ToolboxBitmap] etc. stuff should be considered)
CodePudding user response:
If you are trying to drag another folder into your solution folder, then you can use the default windows file explorer. If you want to import a library from another project, simply right click Dependencies->add project reference, browse, and select the library. In general, you should avoid copying the code itself, and instead add a reference to the output.
Hope I could help, if I misunderstood your question I apologize!