DataGridView locked on a inherited UserControl

前端 未结 5 1373
慢半拍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:21

    Change property to defined [private] to [protected] defined at xx.designer.cs which is originally machine generated code.

    for example

        private System.Windows.Forms.Button btnSave;
    

    to

        protected System.Windows.Forms.Button btnSave;
    

    and rebuild it.

    then you can change the property of inherited control.

提交回复
热议问题