Closed IVTore closed 2 years ago
Are there any exception messages, any stack traces? Anything other we can use to diagnose the issue you are having?
To my knowledge it should be possible to subclass GLControl, but @seanofw might know more details.
The GLControl can be subclassed (it's not marked sealed
for a reason), but some care must be taken when subclassing it:
override
you add invokes the base
method, or its behavior is both unspecified (and unpredictable). Some of those base methods are critical to its functionality, so override at your own risk.It's safest not to subclass it and to instead bind to the events it raises, but there's no explicit prohibition on doing so. Just be aware that subclassing is effectively using it in "expert mode," so if you don't know WinForms and Win32 inside-out upside-down and backwards, you may run into trouble.
Thank you for your enlightening answers. Since I am not after being a winforms guru, (why restrict myself?) I will keep on wrapping approach, which is working fine.
I am building a class library with .Net 5. Designer does its brilliant job by giving exception messages which goes nowhere :) . Is it impossible to subclass GLControl? I am using the wrapper approach as a workaround for now.