Miscellaneous questions about converting VO code to X#

This forum is meant for questions and discussions about the X# language and tools
User avatar
Kees Bouw
Posts: 118
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Re: Miscellaneous questions about converting VO code to X#

Post by Kees Bouw »

Hi Chris,

Thank you very much for your reply. Using NEW is indeed the answer, now that you mentioned this I looked at the "Class hierarchy modifiers" page in the online documentation again and it is explained there. I did see this page yesterday but I did not read it carefully because there was so much text and I missed the NEW keyword. Instead I tried OVERRIDE which did not work. Sorry about that but thank you for helping me out.
I have already created an alternative for the windows hierarchy problems. I separated the two underlying classes from the winform and use them by passing the winform object to them. So now the winform itself inherits from the Form class directly again and this works. It is quite a large application with a complicated structure and I have added and imported a lot of code, I feel that it may be difficult to isolate the problem. Also there is a fair chance that if I do that in a new test app then the problem can't be reproduced. This has happened before. I don't think it will be worth the time and effort at the moment.

Kees.
User avatar
Chris
Posts: 4770
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Miscellaneous questions about converting VO code to X#

Post by Chris »

Hi Kees,

Yes, OVERRIDE is for overriding a parent method which is VIRTUAL. In this case, the method is not virtual (it was done on purpose this way, so you cannot override it), so you need to define a new method as NEW, if you want to use the same name.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply