ATML1671Translator.forms.ATMLTranslatorToolWindow.ResizePropertyGrid C# (CSharp) Method

ResizePropertyGrid() private method

private ResizePropertyGrid ( ) : void
return void
        private void ResizePropertyGrid()
        {
            if (dgPropertyInfo.Columns.Count > 0)
            {
                int rows = dgPropertyInfo.Rows.GetRowsHeight( DataGridViewElementStates.Visible );
                int header = dgPropertyInfo.ColumnHeadersHeight;
                int height = dgPropertyInfo.Height;
                bool vbarVisible = ( height - header ) < rows;
                if (dgPropertyInfo.Columns.Count >= 2 )
                {
                    dgPropertyInfo.Columns[0].Width = (int) ( dgPropertyInfo.Width*.30 );
                    dgPropertyInfo.Columns[1].Width = dgPropertyInfo.Width -
                                                      ( dgPropertyInfo.Columns[0].Width
                                                        + ( vbarVisible ? SystemInformation.VerticalScrollBarWidth : 0 )
                                                        + 3 );
                }
            }
        }
ATMLTranslatorToolWindow