Im using VB.net Winforms and want to inherit a button, to make it resizable for the end-user, the code I have works great (found elsewhere) and is below.
So start off with blank winforms, Form1, right click on Solution, Add User Control, then open up the Designer Code of that code, scrub the Public Class UserControl1 and replace it with the following code;
Partial Class ResizableButton
Inherits Button
Protected Overrides ReadOnly Property CreateParams As System.Windows.Forms.CreateParams
Get
Dim CP As CreateParams = MyBase.CreateParams
CP.Style = CP.Style Or &H40000
Return CP
End Get
End Property
End Class
Save, compile, and there is now a new control in your toolbox called Reizable Control.
Run the vb app and you can now resize (as an end-user) the control on the form. Great. Fantastic. Whoohoo.
But - my button has this ugly butt user control surrounding my button - I dont want that, I want "a button".
Ive tried looking for this but im not seeing any mention in any tutorials on inheriting controls on how to get rid. Please help :)
What I have tried:
Searching the internet, reading up on Inheritance but no mention of this space between a Usercontrol and an inherited control