void ShowDiffPanel() { // Add property grid to split container. splitContainer.Panel2.Controls.Remove(propertyGrid); diffSplitContainer.Panel1.Controls.Add(propertyGrid); // Fix the tab order. diffSplitContainer.TabStop = true; // Bring the split container to the front. diffSplitContainer.BringToFront(); }
private void SetSplitContainerToFill(SplitContainer container) { container.Dock = DockStyle.Fill; container.BringToFront(); }
private void InitializeComponent() { _addRootButton = new Button(); _addChildButton = new Button(); _deleteButton = new Button(); _dialogBlock = new NuGenCollectionEditorDialogBlock(); _mainBlock = new NuGenCollectionEditorMainBlock(); _moveDownButton = _mainBlock.GetMoveDownButton(); _moveUpButton = _mainBlock.GetMoveUpButton(); _propertyBlock = new NuGenCollectionEditorPropertyBlock(); _splitContainer = new SplitContainer(); _treeView = new NodesEditorTreeView(); this.SuspendLayout(); /* DialogBlock */ _dialogBlock.Dock = DockStyle.Bottom; _dialogBlock.Parent = this; _dialogBlock.TabIndex = 10; Button okButton = _dialogBlock.GetOkButton(); Button cancelButton = _dialogBlock.GetCancelButton(); okButton.Click += _okButton_Click; cancelButton.Click += _cancelButton_Click; /* SplitContainer */ _splitContainer.Dock = DockStyle.Fill; _splitContainer.Panel1MinSize = 250; _splitContainer.Panel2MinSize = 100; _splitContainer.Parent = this; _splitContainer.BringToFront(); /* MainBlock */ _mainBlock.Dock = DockStyle.Fill; _mainBlock.Parent = _splitContainer.Panel1; _mainBlock.TabIndex = 20; _mainBlock.SetTitle(Resources.Text_TreeNodeCollectionEditor_mainTitle); /* Action buttons */ _moveDownButton.Click += _moveDownButton_Click; _moveUpButton.Click += _moveUpButton_Click; _deleteButton.Dock = DockStyle.Top; _deleteButton.Image = Resources.Delete; _deleteButton.Click += _deleteButton_Click; Control.ControlCollection actionControls = _mainBlock.GetActionControls(); actionControls.Add(_deleteButton); _deleteButton.BringToFront(); /* Populate buttons */ _addRootButton.Dock = DockStyle.Left; _addRootButton.TabIndex = 10; _addRootButton.Text = Resources.Text_TreeNodeCollectionEditor_addRootButton; _addRootButton.Click += _addRootButton_Click; _addChildButton.Dock = DockStyle.Left; _addChildButton.TabIndex = 20; _addChildButton.Text = Resources.Text_TreeNodeCollectionEditor_addChildButton; _addChildButton.Click += _addChildButton_Click; Control.ControlCollection populateControls = _mainBlock.GetPopulateControls(); populateControls.Add(_addChildButton); populateControls.Add(_addRootButton); /* PropertyBlock */ _propertyBlock.Dock = DockStyle.Fill; _propertyBlock.Parent = _splitContainer.Panel2; _propertyBlock.TabIndex = 30; _propertyBlock.SetTitle(Resources.Text_TreeNodeCollectionEditor_propertyTitleNone); _propertyBlock.SelectedObjectsChanged += _propertyBlock_SelectedObjectsChanged; /* TreeView */ _treeView.Dock = DockStyle.Fill; _treeView.Parent = _mainBlock; _treeView.BringToFront(); _treeView.AfterSelect += _treeView_AfterSelect; /* Form */ NuGenCollectionEditorInitializer.InitializeEditorForm(this); this.AcceptButton = okButton; this.CancelButton = cancelButton; this.Size = new Size(580, 480); this.MinimumSize = this.Size; this.Text = Resources.Text_TreeNodeCollectionEditor_EditorForm; base.ResumeLayout(false); }