Beispiel #1
0
        /// <summary>
        /// Constructor using given PropertyGridView and mode flags</summary>
        /// <param name="mode">The flags specifying the PropertyGrid's features and appearance</param>
        /// <param name="propertyGridView">The customized PropertyGridView</param>
        public PropertyGrid(PropertyGridMode mode, PropertyGridView propertyGridView)
        {
            m_propertyGridView = propertyGridView;
            m_propertyGridView.BackColor = SystemColors.Window;
            m_propertyGridView.Dock = DockStyle.Fill;
            m_propertyGridView.EditingContextChanged += propertyGrid_EditingContextChanged;
            m_propertyGridView.MouseUp += propertyGrid_MouseUp;
            m_propertyGridView.DragOver += propertyGrid_DragOver;
            m_propertyGridView.DragDrop += propertyGrid_DragDrop;
            m_propertyGridView.MouseHover += propertyGrid_MouseHover;
            m_propertyGridView.MouseLeave += propertyGrid_MouseLeave;
            if (m_descriptionTextBox != null)
            {
                m_propertyGridView.DescriptionSetter = p =>
                {
                    if (p != null)
                        m_descriptionTextBox.SetDescription(p.DisplayName, p.Description);
                    else
                        m_descriptionTextBox.ClearDescription();
                };
            }

            m_toolStrip = new ToolStrip();
            m_toolStrip.GripStyle = ToolStripGripStyle.Hidden;
            m_toolStrip.Dock = DockStyle.Top;

            if ((mode & PropertyGridMode.PropertySorting) != 0)
            {
                m_propertyOrganization = new ToolStripDropDownButton(null, s_categoryImage);
                m_propertyOrganization.ToolTipText = "Property Organization".Localize(
                    "Could be rephrased as 'How do you want these properties to be organized?'");
                m_propertyOrganization.ImageTransparentColor = Color.Magenta;
                m_propertyOrganization.DropDownItemClicked += organization_DropDownItemClicked;

                var item1 = new ToolStripMenuItem("Unsorted".Localize());
                item1.Tag = PropertySorting.None;

                var item2 = new ToolStripMenuItem("Alphabetical".Localize());
                item2.Tag = PropertySorting.Alphabetical;

                var item3 = new ToolStripMenuItem("Categorized".Localize());
                item3.Tag = PropertySorting.Categorized;

                var item4 = new ToolStripMenuItem("Categorized Alphabetical Properties".Localize());
                item4.Tag = PropertySorting.Categorized | PropertySorting.Alphabetical;

                var item5 = new ToolStripMenuItem("Alphabetical Categories".Localize());
                item5.Tag = PropertySorting.Categorized | PropertySorting.CategoryAlphabetical;

                var item6 = new ToolStripMenuItem("Alphabetical Categories And Properties".Localize());
                item6.Tag = PropertySorting.ByCategory;

                m_propertyOrganization.DropDownItems.Add(item1);
                m_propertyOrganization.DropDownItems.Add(item2);
                m_propertyOrganization.DropDownItems.Add(item3);
                m_propertyOrganization.DropDownItems.Add(item4);
                m_propertyOrganization.DropDownItems.Add(item5);
                m_propertyOrganization.DropDownItems.Add(item6);

                m_toolStrip.Items.Add(m_propertyOrganization);
                m_toolStrip.Items.Add(new ToolStripSeparator());
            }

            if ((mode & PropertyGridMode.DisableSearchControls) == 0)
            {
                var dropDownButton = new ToolStripDropDownButton();
                dropDownButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
                dropDownButton.Image = ResourceUtil.GetImage16(Resources.SearchImage);
                dropDownButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                dropDownButton.Name = "PropertyGridSearchButton";
                dropDownButton.Size = new System.Drawing.Size(29, 22);
                dropDownButton.Text = "Search".Localize("'Search' is a verb");

                m_patternTextBox = new ToolStripAutoFitTextBox();
                m_patternTextBox.Name = "patternTextBox";
                m_patternTextBox.MaximumWidth = 1080;
                m_patternTextBox.KeyUp += patternTextBox_KeyUp;
                m_patternTextBox.TextBox.PreviewKeyDown += patternTextBox_PreviewKeyDown;

                var clearSearchButton = new ToolStripButton();
                clearSearchButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
                clearSearchButton.Image = ResourceUtil.GetImage16(Resources.DeleteImage);
                dropDownButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                clearSearchButton.Name = "PropertyGridClearSearchButton";
                clearSearchButton.Size = new System.Drawing.Size(29, 22);
                clearSearchButton.Text = "Clear Search".Localize("'Clear' is a verb");
                clearSearchButton.Click += clearSearchButton_Click;

                m_toolStrip.Items.AddRange(
                    new ToolStripItem[] { 
                    dropDownButton, 
                    m_patternTextBox,
                    clearSearchButton
                    });
            }

            if ((mode & PropertyGridMode.HideResetAllButton) == 0)
            {
                // Reset all button.
                var resetAllButton = new ToolStripButton();
                resetAllButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
                resetAllButton.Image = ResourceUtil.GetImage16(Resources.ResetImage);
                resetAllButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                resetAllButton.Name = "PropertyGridResetAllButton";
                resetAllButton.Size = new Size(29, 22);
                resetAllButton.ToolTipText = "Reset all properties".Localize();
                resetAllButton.Click += (sender, e) =>
                    {
                        ITransactionContext transaction = m_propertyGridView.EditingContext.As<ITransactionContext>();                        
                        transaction.DoTransaction(delegate
                        {
                            ResetAll();
                        },
                        "Reset All Properties".Localize("'Reset' is a verb and this is the name of a command"));
                    };
                m_toolStrip.Items.Add(resetAllButton);
            }

            if ((mode & PropertyGridMode.AllowEditingComposites) != 0)
            {
                m_navigateOut = new ToolStripButton(null, s_navigateOutImage, navigateOut_Click);
                m_navigateOut.Enabled = true;
                m_navigateOut.ToolTipText = "Navigate back to parent of selected object".Localize();

                m_toolStrip.Items.Add(m_navigateOut);

                m_propertyGridView.AllowEditingComposites = true;
            }

            SuspendLayout();

            if ((mode & PropertyGridMode.DisplayTooltips) != 0)
                m_propertyGridView.AllowTooltips = true;

            if ((mode & PropertyGridMode.DisplayDescriptions) == 0)
                Controls.Add(m_propertyGridView);
            else
            {
                m_splitContainer.Orientation = Orientation.Horizontal;
                m_splitContainer.BackColor = SystemColors.InactiveBorder;
                m_splitContainer.FixedPanel = FixedPanel.Panel2;
                m_splitContainer.SplitterWidth = 8;
                m_splitContainer.Dock = DockStyle.Fill;

                m_splitContainer.Panel1.Controls.Add(m_propertyGridView);

                m_descriptionTextBox = new DescriptionControl(this);
                m_descriptionTextBox.BackColor = SystemColors.Window;
                m_descriptionTextBox.Dock = DockStyle.Fill;

                m_splitContainer.Panel2.Controls.Add(m_descriptionTextBox);
                Controls.Add(m_splitContainer);

                m_propertyGridView.SelectedPropertyChanged += propertyGrid_SelectedRowChanged;
                m_descriptionTextBox.ClearDescription();
            }

            if (m_toolStrip.Items.Count > 0)
            {
                UpdateToolstripItems();
                Controls.Add(m_toolStrip);
            }
            else
            {
                m_toolStrip.Dispose();
                m_toolStrip = null;
            }

            Name = "PropertyGrid";
            Font = m_propertyGridView.Font;
            FontChanged += (sender, e) => m_propertyGridView.Font = Font;                
            ResumeLayout(false);
            PerformLayout();            
        }
Beispiel #2
0
        /// <summary>
        /// Constructor using given PropertyGridView and mode flags</summary>
        /// <param name="mode">The flags specifying the PropertyGrid's features and appearance</param>
        /// <param name="propertyGridView">The customized PropertyGridView</param>
        public PropertyGrid(PropertyGridMode mode, PropertyGridView propertyGridView)
        {
            m_propertyGridView                        = propertyGridView;
            m_propertyGridView.BackColor              = SystemColors.Window;
            m_propertyGridView.Dock                   = DockStyle.Fill;
            m_propertyGridView.EditingContextChanged += propertyGrid_EditingContextChanged;
            m_propertyGridView.MouseUp               += propertyGrid_MouseUp;
            m_propertyGridView.DragOver              += propertyGrid_DragOver;
            m_propertyGridView.DragDrop              += propertyGrid_DragDrop;
            m_propertyGridView.MouseHover            += propertyGrid_MouseHover;
            m_propertyGridView.MouseLeave            += propertyGrid_MouseLeave;
            m_propertyGridView.DescriptionSetter      = p =>
            {
                if (p != null)
                {
                    m_descriptionTextBox.SetDescription(p.DisplayName, p.Description);
                }
                else
                {
                    m_descriptionTextBox.ClearDescription();
                }
            };

            m_toolStrip           = new ToolStrip();
            m_toolStrip.GripStyle = ToolStripGripStyle.Hidden;
            m_toolStrip.Dock      = DockStyle.Top;

            if ((mode & PropertyGridMode.PropertySorting) != 0)
            {
                m_propertyOrganization             = new ToolStripDropDownButton(null, s_categoryImage);
                m_propertyOrganization.ToolTipText = "Property Organization".Localize(
                    "Could be rephrased as 'How do you want these properties to be organized?'");
                m_propertyOrganization.ImageTransparentColor = Color.Magenta;
                m_propertyOrganization.DropDownItemClicked  += organization_DropDownItemClicked;

                var item1 = new ToolStripMenuItem("Unsorted".Localize());
                item1.Tag = PropertySorting.None;

                var item2 = new ToolStripMenuItem("Alphabetical".Localize());
                item2.Tag = PropertySorting.Alphabetical;

                var item3 = new ToolStripMenuItem("Categorized".Localize());
                item3.Tag = PropertySorting.Categorized;

                var item4 = new ToolStripMenuItem("Categorized Alphabetical Properties".Localize());
                item4.Tag = PropertySorting.Categorized | PropertySorting.Alphabetical;

                var item5 = new ToolStripMenuItem("Alphabetical Categories".Localize());
                item5.Tag = PropertySorting.Categorized | PropertySorting.CategoryAlphabetical;

                var item6 = new ToolStripMenuItem("Alphabetical Categories And Properties".Localize());
                item6.Tag = PropertySorting.ByCategory;

                m_propertyOrganization.DropDownItems.Add(item1);
                m_propertyOrganization.DropDownItems.Add(item2);
                m_propertyOrganization.DropDownItems.Add(item3);
                m_propertyOrganization.DropDownItems.Add(item4);
                m_propertyOrganization.DropDownItems.Add(item5);
                m_propertyOrganization.DropDownItems.Add(item6);

                m_toolStrip.Items.Add(m_propertyOrganization);
                m_toolStrip.Items.Add(new ToolStripSeparator());
            }

            if ((mode & PropertyGridMode.DisableSearchControls) == 0)
            {
                var dropDownButton = new ToolStripDropDownButton();
                dropDownButton.DisplayStyle          = ToolStripItemDisplayStyle.Image;
                dropDownButton.Image                 = ResourceUtil.GetImage16(Resources.SearchImage);
                dropDownButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                dropDownButton.Name = "PropertyGridSearchButton";
                dropDownButton.Size = new System.Drawing.Size(29, 22);
                dropDownButton.Text = "Search".Localize("'Search' is a verb");

                m_patternTextBox                         = new ToolStripAutoFitTextBox();
                m_patternTextBox.Name                    = "patternTextBox";
                m_patternTextBox.MaximumWidth            = 1080;
                m_patternTextBox.KeyUp                  += patternTextBox_KeyUp;
                m_patternTextBox.TextBox.PreviewKeyDown += patternTextBox_PreviewKeyDown;

                var clearSearchButton = new ToolStripButton();
                clearSearchButton.DisplayStyle       = ToolStripItemDisplayStyle.Image;
                clearSearchButton.Image              = ResourceUtil.GetImage16(Resources.DeleteImage);
                dropDownButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                clearSearchButton.Name   = "PropertyGridClearSearchButton";
                clearSearchButton.Size   = new System.Drawing.Size(29, 22);
                clearSearchButton.Text   = "Clear Search".Localize("'Clear' is a verb");
                clearSearchButton.Click += clearSearchButton_Click;

                m_toolStrip.Items.AddRange(
                    new ToolStripItem[] {
                    dropDownButton,
                    m_patternTextBox,
                    clearSearchButton
                });
            }

            if ((mode & PropertyGridMode.HideResetAllButton) == 0)
            {
                // Reset all button.
                var resetAllButton = new ToolStripButton();
                resetAllButton.DisplayStyle          = ToolStripItemDisplayStyle.Image;
                resetAllButton.Image                 = ResourceUtil.GetImage16(Resources.ResetImage);
                resetAllButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                resetAllButton.Name        = "PropertyGridResetAllButton";
                resetAllButton.Size        = new Size(29, 22);
                resetAllButton.ToolTipText = "Reset all properties".Localize();
                resetAllButton.Click      += (sender, e) =>
                {
                    ITransactionContext transaction = m_propertyGridView.EditingContext.As <ITransactionContext>();
                    transaction.DoTransaction(delegate
                    {
                        ResetAll();
                    },
                                              "Reset All Properties".Localize("'Reset' is a verb and this is the name of a command"));
                };
                m_toolStrip.Items.Add(resetAllButton);
            }

            if ((mode & PropertyGridMode.AllowEditingComposites) != 0)
            {
                m_navigateOut             = new ToolStripButton(null, s_navigateOutImage, navigateOut_Click);
                m_navigateOut.Enabled     = true;
                m_navigateOut.ToolTipText = "Navigate back to parent of selected object".Localize();

                m_toolStrip.Items.Add(m_navigateOut);

                m_propertyGridView.AllowEditingComposites = true;
            }

            SuspendLayout();

            if ((mode & PropertyGridMode.DisplayTooltips) != 0)
            {
                m_propertyGridView.AllowTooltips = true;
            }

            if ((mode & PropertyGridMode.DisplayDescriptions) == 0)
            {
                Controls.Add(m_propertyGridView);
            }
            else
            {
                m_splitContainer.Orientation   = Orientation.Horizontal;
                m_splitContainer.BackColor     = SystemColors.InactiveBorder;
                m_splitContainer.FixedPanel    = FixedPanel.Panel2;
                m_splitContainer.SplitterWidth = 8;
                m_splitContainer.Dock          = DockStyle.Fill;

                m_splitContainer.Panel1.Controls.Add(m_propertyGridView);

                m_descriptionTextBox           = new DescriptionControl(this);
                m_descriptionTextBox.BackColor = SystemColors.Window;
                m_descriptionTextBox.Dock      = DockStyle.Fill;

                m_splitContainer.Panel2.Controls.Add(m_descriptionTextBox);
                Controls.Add(m_splitContainer);

                m_propertyGridView.SelectedPropertyChanged += propertyGrid_SelectedRowChanged;
                m_descriptionTextBox.ClearDescription();
            }

            if (m_toolStrip.Items.Count > 0)
            {
                UpdateToolstripItems();
                Controls.Add(m_toolStrip);
            }
            else
            {
                m_toolStrip.Dispose();
                m_toolStrip = null;
            }

            Name         = "PropertyGrid";
            Font         = m_propertyGridView.Font;
            FontChanged += (sender, e) => m_propertyGridView.Font = Font;
            ResumeLayout(false);
            PerformLayout();
        }
Beispiel #3
0
 /// <summary>
 /// Constructor using the default PropertyGridView and the given mode flags</summary>
 /// <param name="mode">Flags specifying the PropertyGrid's features and appearance</param>
 public PropertyGrid(PropertyGridMode mode)
     : this(mode, new PropertyGridView())
 {
 }
Beispiel #4
0
 /// <summary>
 /// Constructor using the default PropertyGridView and the given mode flags</summary>
 /// <param name="mode">Flags specifying the PropertyGrid's features and appearance</param>
 public PropertyGrid(PropertyGridMode mode)
     : this(mode, new PropertyGridView())
 {
 }
Beispiel #5
0
        /// <summary>
        /// Constructor</summary>
        /// <param name="mode">Flags specifiying the GridControl's features and appearance</param>
        /// <param name="gridView">The GridView to be used. Can be sub-classed to customize its behavior.</param>
        public GridControl(PropertyGridMode mode, GridView gridView)
        {
            m_gridView = gridView;
            m_gridView.BackColor = SystemColors.Window;
            m_gridView.Dock = DockStyle.Fill;
            m_gridView.EditingContextChanged += gridView_BindingChanged;
            m_gridView.MouseUp += gridView_MouseUp;
            m_gridView.DragOver += gridView_DragOver;
            m_gridView.DragDrop += gridView_DragDrop;
            m_gridView.MouseHover += gridView_MouseHover;
            m_gridView.MouseLeave += gridView_MouseLeave;
            m_gridView.SelectedPropertyChanged += gridView_SelectedPropertyChanged;

            m_toolStrip = new ToolStrip();
            m_toolStrip.GripStyle = ToolStripGripStyle.Hidden;
            m_toolStrip.Dock = DockStyle.Top;

            if ((mode & PropertyGridMode.PropertySorting) != 0)
            {
                m_propertyOrganization = new ToolStripDropDownButton(null, s_categoryImage);
                m_propertyOrganization.ToolTipText = "Property Organization".Localize(
                    "Could be rephrased as 'How do you want these properties to be organized?'");
                //m_propertyOrganization.ImageTransparentColor = Color.Magenta;
                m_propertyOrganization.DropDownItemClicked += organization_DropDownItemClicked;

                ToolStripMenuItem item1 = new ToolStripMenuItem("Unsorted".Localize());
                item1.Tag = PropertySorting.None;

                ToolStripMenuItem item2 = new ToolStripMenuItem("Alphabetical".Localize());
                item2.Tag = PropertySorting.Alphabetical;

                ToolStripMenuItem item3 = new ToolStripMenuItem("Categorized".Localize());
                item3.Tag = PropertySorting.Categorized;

                ToolStripMenuItem item4 = new ToolStripMenuItem("Categorized Alphabetical Properties".Localize());
                item4.Tag = PropertySorting.Categorized | PropertySorting.Alphabetical;

                ToolStripMenuItem item5 = new ToolStripMenuItem("Alphabetical Categories".Localize());
                item5.Tag = PropertySorting.Categorized | PropertySorting.CategoryAlphabetical;

                ToolStripMenuItem item6 = new ToolStripMenuItem("Alphabetical Categories And Properties".Localize());
                item6.Tag = PropertySorting.ByCategory;

                m_propertyOrganization.DropDownItems.Add(item1);
                m_propertyOrganization.DropDownItems.Add(item2);
                m_propertyOrganization.DropDownItems.Add(item3);
                m_propertyOrganization.DropDownItems.Add(item4);
                m_propertyOrganization.DropDownItems.Add(item5);
                m_propertyOrganization.DropDownItems.Add(item6);

                m_toolStrip.Items.Add(m_propertyOrganization);
                m_toolStrip.Items.Add(new ToolStripSeparator());
            }

            if ((mode & PropertyGridMode.ShowHideProperties) != 0)
            {
                m_propertyShowHideButton = new ToolStripButton(null, s_showHidePropertiesImage);
                m_propertyShowHideButton.ToolTipText = "Property Show / Hide".Localize();
                m_propertyShowHideButton.Click += propertyShowHide_Click;
                m_toolStrip.Items.Add(m_propertyShowHideButton);
                m_toolStrip.Items.Add(new ToolStripSeparator());
            }

            if ((mode & PropertyGridMode.DisableDragDropColumnHeaders) != 0)
            {
                m_gridView.DragDropColumnsEnabed = false;
            }

            m_descriptionLabel = new ToolStripAutoFitLabel();
            m_descriptionLabel.TextAlign = ContentAlignment.TopLeft;
            m_descriptionLabel.MaximumWidth = 5000;
            m_toolStrip.Items.Add(m_descriptionLabel);

            SuspendLayout();

            Controls.Add(m_gridView);

            if (m_toolStrip.Items.Count > 0)
            {
                UpdateToolstripItems();
                Controls.Add(m_toolStrip);
            }
            else
            {
                m_toolStrip.Dispose();
                m_toolStrip = null;
            }
            Font = new Font("Segoe UI", 9.0f);

            ResumeLayout(false);
            PerformLayout();
        }
Beispiel #6
0
 /// <summary>
 /// Constructor with PropertyGridMode</summary>
 /// <param name="mode">Flags specifiying the GridControl's features and appearance</param>
 public GridControl(PropertyGridMode mode)
     : this(mode, new GridView())
 {
 }
Beispiel #7
0
        /// <summary>
        /// Constructor</summary>
        /// <param name="mode">Flags specifiying the GridControl's features and appearance</param>
        /// <param name="gridView">The GridView to be used. Can be sub-classed to customize its behavior.</param>
        public GridControl(PropertyGridMode mode, GridView gridView)
        {
            m_gridView                          = gridView;
            m_gridView.BackColor                = SystemColors.Window;
            m_gridView.Dock                     = DockStyle.Fill;
            m_gridView.EditingContextChanged   += gridView_BindingChanged;
            m_gridView.MouseUp                 += gridView_MouseUp;
            m_gridView.DragOver                += gridView_DragOver;
            m_gridView.DragDrop                += gridView_DragDrop;
            m_gridView.MouseHover              += gridView_MouseHover;
            m_gridView.MouseLeave              += gridView_MouseLeave;
            m_gridView.SelectedPropertyChanged += gridView_SelectedPropertyChanged;

            m_toolStrip           = new ToolStrip();
            m_toolStrip.GripStyle = ToolStripGripStyle.Hidden;
            m_toolStrip.Dock      = DockStyle.Top;

            if ((mode & PropertyGridMode.PropertySorting) != 0)
            {
                m_propertyOrganization             = new ToolStripDropDownButton(null, s_categoryImage);
                m_propertyOrganization.ToolTipText = "Property Organization".Localize(
                    "Could be rephrased as 'How do you want these properties to be organized?'");
                //m_propertyOrganization.ImageTransparentColor = Color.Magenta;
                m_propertyOrganization.DropDownItemClicked += organization_DropDownItemClicked;

                ToolStripMenuItem item1 = new ToolStripMenuItem("Unsorted".Localize());
                item1.Tag = PropertySorting.None;

                ToolStripMenuItem item2 = new ToolStripMenuItem("Alphabetical".Localize());
                item2.Tag = PropertySorting.Alphabetical;

                ToolStripMenuItem item3 = new ToolStripMenuItem("Categorized".Localize());
                item3.Tag = PropertySorting.Categorized;

                ToolStripMenuItem item4 = new ToolStripMenuItem("Categorized Alphabetical Properties".Localize());
                item4.Tag = PropertySorting.Categorized | PropertySorting.Alphabetical;

                ToolStripMenuItem item5 = new ToolStripMenuItem("Alphabetical Categories".Localize());
                item5.Tag = PropertySorting.Categorized | PropertySorting.CategoryAlphabetical;

                ToolStripMenuItem item6 = new ToolStripMenuItem("Alphabetical Categories And Properties".Localize());
                item6.Tag = PropertySorting.ByCategory;

                m_propertyOrganization.DropDownItems.Add(item1);
                m_propertyOrganization.DropDownItems.Add(item2);
                m_propertyOrganization.DropDownItems.Add(item3);
                m_propertyOrganization.DropDownItems.Add(item4);
                m_propertyOrganization.DropDownItems.Add(item5);
                m_propertyOrganization.DropDownItems.Add(item6);

                m_toolStrip.Items.Add(m_propertyOrganization);
                m_toolStrip.Items.Add(new ToolStripSeparator());
            }

            if ((mode & PropertyGridMode.ShowHideProperties) != 0)
            {
                m_propertyShowHideButton             = new ToolStripButton(null, s_showHidePropertiesImage);
                m_propertyShowHideButton.ToolTipText = "Property Show / Hide".Localize();
                m_propertyShowHideButton.Click      += propertyShowHide_Click;
                m_toolStrip.Items.Add(m_propertyShowHideButton);
                m_toolStrip.Items.Add(new ToolStripSeparator());
            }

            if ((mode & PropertyGridMode.DisableDragDropColumnHeaders) != 0)
            {
                m_gridView.DragDropColumnsEnabed = false;
            }

            m_descriptionLabel              = new ToolStripAutoFitLabel();
            m_descriptionLabel.TextAlign    = ContentAlignment.TopLeft;
            m_descriptionLabel.MaximumWidth = 5000;
            m_toolStrip.Items.Add(m_descriptionLabel);

            SuspendLayout();

            Controls.Add(m_gridView);

            if (m_toolStrip.Items.Count > 0)
            {
                UpdateToolstripItems();
                Controls.Add(m_toolStrip);
            }
            else
            {
                m_toolStrip.Dispose();
                m_toolStrip = null;
            }
            Font = new Font("Segoe UI", 9.0f);

            ResumeLayout(false);
            PerformLayout();
        }
Beispiel #8
0
 /// <summary>
 /// Constructor with PropertyGridMode</summary>
 /// <param name="mode">Flags specifiying the GridControl's features and appearance</param>
 public GridControl(PropertyGridMode mode)
     : this(mode, new GridView())
 {
 }