Question Non-Resizable custom control

Pirahnaplant

Well-known member
Joined
Mar 29, 2009
Messages
75
Programming Experience
3-5
How can I make a custom control that inherits from System.Windows.Forms.UserControl not be resizable (It doesn't have the size property, or it is readonly)
 
Do something like this:

VB.NET:
Public Overrides Property Size() As Size
      Get
            Size = Me.Size
      End Get
      Set(Byval value As Size)
            'do nothing...let's forget that something happened
      End Set
End Property
Public Sub New()
      Me.Size = New Size(whateversizeyoudlike)
End Sub

ALso, you could try to override it with an readonly property, but I'm not sure if that would work.

Bobby
 
Back
Top