Use the Extends syntax from a module method to extend the class interface. You still need to use a class interface, but this way all the common code can be placed in the module instead of being duplicated across multiple classes.
Interface FooInterface
Sub Foo()
End Interface
Class Foo
Implements FooInterface
Sub Foo()
MsgBox("Foo!")
End Sub
End Class
Class Bar
Implements FooInterface
Sub Foo()
MsgBox("Bar!")
End Sub
End Class
Module FooExtensions
Sub Foobar(Extends FooImplementor As FooInterface)
MsgBox("Foobar!")
End Sub
End Module
The above FooBar method would be called like a class method of any class that implements the FooInterface class interface:
Dim myfoo As FooInterface = New Bar
myfoo.Foobar()
Note that extension methods don't count when the compiler is deciding whether a given class satisfies an interface.
This may not be workable, however, since the extension methods will only have access to the Interface rather than the actual class.
Alternatively, you could extend the RectControl
class, though that would include all desktop controls, not just the PushButton and BevelButton.
A third option might be to use the BevelButton class exclusively.