UserControl扩展ScrollableControl - 禁用容器功能

Mis*_*siu 5 .net c# user-controls winforms

我正在通过扩展来构建自定义控件ScrollableControl.
问题是我的自定义控件充当容器 - 我可以将控件拖入其中: 在此输入图像描述

我的问题是如何在扩展的类中禁用容器功能 ScrollableControl

下面是两个测试控件,一个扩展Control,第二个ScrollableControl

public class ControlBasedControl : Control
{
    protected override Size DefaultSize
    {
        get { return new Size(100, 100); }
    }

    protected override void OnPaint(PaintEventArgs e)
    {
        base.OnPaint(e);
        e.Graphics.FillRectangle(Brushes.LightCoral, ClientRectangle);
    }
}

public class ScrollableControlBasedControl : ScrollableControl
{
    public ScrollableControlBasedControl()
    {
        AutoScrollMinSize = new Size(200, 200);
    }

    protected override Size DefaultSize
    {
        get { return new Size(100, 100); }
    }

    protected override void OnPaint(PaintEventArgs e)
    {
        base.OnPaint(e);
        e.Graphics.FillRectangle(Brushes.LawnGreen, ClientRectangle);
    }
}
Run Code Online (Sandbox Code Playgroud)