Disable the "Close" button of a form

0

Does anyone know how I disable the "Close" ("X") button of a form in VB.NET?

    
asked by anonymous 20.06.2018 / 17:43

1 answer

2

Put this in your form's codebehind,

Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
    Dim param As CreateParams = MyBase.CreateParams
    param.ClassStyle = param.ClassStyle Or &H200
    Return param
End Get
End Property

Source: here

    
20.06.2018 / 18:20