active,
It depends.
First, which control are you referring to? Checking in Reflector
(
http://www.aisto.com/roeder/dotnet/), this could include the ListBox,
CheckedListBox, ComboBox, ListView, MenuItem, StatusBar or TabControl, all
in the System.Windows.Forms namespace.
I'll pick the ListBox. By overriding the OnDrawItem method (event), you are
saying that you want to handle the functionality contained in the base
method to draw the ListItem yourself. If you want to add to the base
functionality, you can call MyBase.OnDrawItem first. The item is then drawn
per the base code, and then you can 'add' on top of it. If you call it at
the end, you will have overwritten the drawing you may have already
performed. If you don't call it at all, then it is completely up to you to
provide the mechanics to 'draw' the item.
I would recommend building a simple WinForms app, just a throwaway in 2005,
and testing it both ways to get a clearer picture of what I described above.
The key to calling the base method in an override is to understand what
functionality occurs in the base method, whether you want that
functionality, and therefore whether that functionality should occur before
or after the user logic in your derived method.
Hope this helps,
Steve
" active" <ac**********@a-znet.comwrote in message
news:ef**************@TK2MSFTNGP04.phx.gbl...
In
Protected Overrides Sub OnDrawItem
should I call
MyBase.OnDrawItem(e)
at the top or bottom of the sub?
What might happen if I don't call it?
Thanks
I assume any answer to the above applies to
Protected Overrides Sub OnMeasureItem
right?