In my application I am deriving all my forms from a common BaseForm.
Now I need to disable the resizing in the BaseForm so that derived forms are not resizable at design-time.
How to achieve that?
This seems to work:
[BaseForm.cs]
namespace WindowsFormsApplication1
{
using System.Windows.Forms;
public partial class BaseForm : Form
{
public BaseForm()
{
InitializeComponent();
this.MaximumSize = this.MinimumSize = this.Size;
}
}
}
[DerivedForm.cs]
namespace WindowsFormsApplication1
{
public partial class DerivedForm : WindowsFormsApplication1.BaseForm
{
public DerivedForm()
{
InitializeComponent();
}
}
}
i used
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this make window form as like dialogBox. so dialog boxes are not resizable by user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With