Prevent Winforms Designer from Generating Property Values for Inherited Controls

前端 未结 4 1265
清酒与你
清酒与你 2020-12-10 08:24

I have a custom DataGridView, let\'s say as such:

public MyGridView : DataGridView
{
    public MyGridView()
    {
         BackgroundColor = Co         


        
4条回答
  •  独厮守ぢ
    2020-12-10 09:23

    If needs are simple and design appearance is no issue, try writing an extension or two, e.g.,

    public static class Extensions
    {
        public static void ApplyStyle( this DataGridView dataGridView )
        {
            dataGridView.RowHeadersVisible = false;
            ...
        }
    }
    

提交回复
热议问题