override Text but not Image

  • Thread starter Thread starter Tim Mulholland
  • Start date Start date
T

Tim Mulholland

I've come across a bit of an annoyance i'm hoping someone can explain and/or
get me past.

I'm overriding the Text property on a user control i'm writing that inherits
from System.Windows.Forms.Button.
This works beautifully.
However, when i try to do the same thing for the Image property, i find it
won't let me override it.

Looking into the docs, it appears that the Text property is marked as
Virtual, whereas the Image property is not.
Is there any way around this?

Thanks in advance!

-Tim
 
Hi Tim,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to override the Image property
of winform Button control. If there is any misunderstanding, please feel
free to let me know.

As far as I know, the Button.Image is inherited from ButtonBase.Image. It
is a non-virtual property, which means that it is not declared as either
abstract, virtual or override. So, based on C# language reference, it
cannot be inherited and it seem there is no workaround on this.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
that was definitely the conclusion i came to as well.
i just wanted to verify that this was the truth.
 
Back
Top