I am trying to understand classes that you can create yourself and I have a question. Let’s take an example: let’s say we create a class from with Canvas as a Super. If I know for sure that I do not want the new class to accept picture drops, is there a way to remove it from the new class?
True, but if I create a class and drop it on my main window, menu will all the parameters from the original class plus the ones I created are visible. So I was thinking that if my class will never accept picture drops, why offer that parameter to the user? Same thing with Events like Drop Objects.
Also, is there a way to show some settings in the Inspector like the on/off switches for some of my settings or do everything has to be done in the code.
I’m not sure about muffling existing methods, but you can muffle Events by implementing the Event Handlers and not offering Event Definitions to match.
To enable the on/off switches for your properties right-click on the control and select Inspector Behavior.
First of all, thank you. In the Inspector Behavior, I was able to select the extra properties I added and they are now available in the Inspector with the right switches, color selector, or fields.
For the events, by adding a comment line like “// Disabled”, the unwanted events are no longer visible. So, that is another question answered.
Now, let’s say my class draw a rectangle around the canvas. Can I supply some options like: “BorderStyle.SingleLine” or “BorderStyle.DoubleLines”?