Image centering..

  • Thread starter Thread starter Zoury
  • Start date Start date
Z

Zoury

Hi there! :O)

I'm trying to stick a 16x16 pixels image on a 24x24 pixels button. The image
is never centered properly no matter what alignment i sets. there is always
a little margin or something.. any thoughts ? I've tried to override the
OnPaint() events without any success (probably due to a lack of knowlegde in
owner drawn controls.. :O)

btw, is there a way to "subclass" or override a method without having to
create a new inherited class ? if so, would that be programmaticaly correct
or would it break some OO concepts ?

Thanks a lot!
 
Zoury,

Can you show the code that is placing the image on the button (as well
as provide the image)?

Also, there is no way to subclass just a method. You have to create a
type that derives from the original type. If you could do that, then anyone
could just say "I want to override that method" at which point, the base
object has to ask, "which override do I use?"

Hope this helps.
 
Zoury,

I'm running this on VS.NET 2005 Beta, and from what I can tell, it
centers fine. I can't try it on VS.NET 2003. Perhaps someone else can test
it?
 
Back
Top