Overrides and intellisense

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

Hi,

I'm slowly moving from VB.Net to C#.

When using VB.Net in Visual Studio (for Windows and Web Forms) the code
window identifies a set of '(Overrides)'. I am unable to locate and such
IDE/Intellisense help for this in C#. Is it there?

Thanks,

Simon
 
Simon said:
Hi,

I'm slowly moving from VB.Net to C#.

When using VB.Net in Visual Studio (for Windows and Web Forms) the code
window identifies a set of '(Overrides)'. I am unable to locate and such
IDE/Intellisense help for this in C#. Is it there?

I am not entirely sure what you mean, could you elaborate a little?
Unfortunatly I have little experiance with the VB IDE.

If you simply want override intellisense, typing override will bring up a
list of overridable members.
 
When in the VS code window for VB.Net the top left combo has an
'(Overrides)' entry which, when selected, populates the top right combo with
a list of overridable members. Selecting one of these populates code window
with 'stub' override and correct parameters. Fill in the body from here...

From your answer below I tried typing override in a c# code window (ASP and
Windows) and intellisense was not limited to a list of overridable members.
In fact, such members were not even present in the list.

Can you help further? Thanks.
 
Simon said:
When in the VS code window for VB.Net the top left combo has an
'(Overrides)' entry which, when selected, populates the top right combo
with a list of overridable members. Selecting one of these populates code
window with 'stub' override and correct parameters. Fill in the body from
here...

From your answer below I tried typing override in a c# code window (ASP
and Windows) and intellisense was not limited to a list of overridable
members. In fact, such members were not even present in the list.

It should be limited, which version of VS are you using?
The intellisense doesn't include overridable members that already *have*
been overridden, however.

Anyway, I don't think there is anything like that directly in the code
window. You can use the override intellisense or perhaps the class viewer, I
believe.
 
Thanks.

Using the Class Viewer works for me. Right click the relevant member and
choose Add from the context menu.

My version of 'Microsoft Development Environment' is 7.0.9466. Obtained in
VS-->Help-->About.

This is far more involved than the VB code window integration with IDE,
especially when C# events are obtained using the 'Lightrning' icon on the
proerties window. In the VB code window all ovverrides and base class events
are accessed using the top left/right combo boxes. Just out of interest, do
you know why the easier VB approach was not adopted for C#?

Thanks again for the pointers.
 
Simon said:
Thanks.

Using the Class Viewer works for me. Right click the relevant member and
choose Add from the context menu.

My version of 'Microsoft Development Environment' is 7.0.9466. Obtained in
VS-->Help-->About.
Ahh, I see, VS2002 then?

I was testing on 2003, which might explain why override intellisense works
for me. I don't recall waht 2002 was like, except that it was pretty bad all
in all.
This is far more involved than the VB code window integration with IDE,
especially when C# events are obtained using the 'Lightrning' icon on the
proerties window. In the VB code window all ovverrides and base class
events are accessed using the top left/right combo boxes. Just out of
interest, do you know why the easier VB approach was not adopted for C#?

Off hand I can't say, except that the dev team simply didn't chose to put
time into that feature. I don't personally consider the dropdown boxes to be
easy. I like to have everything available from the keyboard(atleast within
one file, navigating with the keyboard can be a pain).

There are a few things, like events, that simply won't work in C# the way
they do in VB. There is no handles clause, so the IDE can't simply determine
which methods handle which events as easily as VB can with
WithEvents+Handles. It is probably possible, but to this point not something
that is worth the effort.
 
Back
Top