Programmerare, skeptiker, sekulärhumanist, antirasist.
Författare till bok om C64 och senbliven lantis.
Röstar pirat.
2009-05-12
One feature that I use every day, really every day, in Visual Basic is shadowing. Like the keyword “new” in C#, it is used to override a method that is not overridable, but unlike the new keyword, shadowing replaces all overloads of a function in the base class. This is so very usefull. Imagine that you are designing a custom dialog, and you want certain arguments to be passed to the ShowDialog function. Create e shadow of it, and code that calls ShowDialog must pass the arguments you have specified in the shadow. It could look like this:
Public Shadows Function ShowDialog(ByVal Owner As IWin32Window, ByVal EntityID As Integer) As DialogResult
This is the one thing that I really miss in C#.
Categories: Visual Basic 9
Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!
Leave a Reply