DataGridView locked on a inherited UserControl

前端 未结 5 1374
慢半拍i
慢半拍i 2020-12-03 14:45

I have a UserControl with some predefined controls (groupbox,button,datagridview) on it, these controls are marked as protected and the components variable is also marked as

5条回答
  •  一个人的身影
    2020-12-03 15:29

    [1] create Your Custom UserControl

    [2] make your custom userControl use the below Inherited DataGridView:

    [Designer(typeof System.Windows.Forms.Design.ControlDesigner))]
    public class InheritedDataGridView : DataGridView { }
    

    [3] Inherit from your Custom UserControl , And viola !!

    [4] Ohh dont forget to add "System.Design" dll

    Enjoy.

提交回复
热议问题