private void InitializeComponent() { this._selectDatabaseLabel = new MxLabel(); this._databaseComboBox = new MxComboBox(); this._newDatabaseGroupBox = new MxGroupBox(); this._databaseTypeLabel = new MxLabel(); this._databaseTypeComboBox = new MxComboBox(); this._infoLabel = new MxInfoLabel(); this._descriptionLabel = new MxLabel(); this._createButton = new MxButton(); this._newDatabaseGroupBox.SuspendLayout(); base.SuspendLayout(); this._selectDatabaseLabel.Location = new Point(12, 0x40); this._selectDatabaseLabel.Name = "_selectDatabaseLabel"; this._selectDatabaseLabel.Size = new Size(100, 0x10); this._selectDatabaseLabel.TabIndex = 0; this._selectDatabaseLabel.Text = "&Select a database"; this._databaseComboBox.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; this._databaseComboBox.DropDownStyle = ComboBoxStyle.DropDownList; this._databaseComboBox.Location = new Point(0x70, 0x3d); this._databaseComboBox.Name = "_databaseComboBox"; this._databaseComboBox.Size = new Size(0x124, 0x15); this._databaseComboBox.TabIndex = 1; this._databaseComboBox.SelectedIndexChanged += new EventHandler(this.OnDatabaseComboBoxSelectedIndexChanged); this._newDatabaseGroupBox.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; this._newDatabaseGroupBox.Controls.Add(this._createButton); this._newDatabaseGroupBox.Controls.Add(this._databaseTypeComboBox); this._newDatabaseGroupBox.Controls.Add(this._databaseTypeLabel); this._newDatabaseGroupBox.Enabled = false; this._newDatabaseGroupBox.Location = new Point(12, 0x60); this._newDatabaseGroupBox.Name = "_newDatabaseGroupBox"; this._newDatabaseGroupBox.Size = new Size(0x188, 80); this._newDatabaseGroupBox.TabIndex = 2; this._newDatabaseGroupBox.TabStop = false; this._newDatabaseGroupBox.Text = "Create a &new database connection"; this._databaseTypeLabel.Location = new Point(12, 0x18); this._databaseTypeLabel.Name = "_databaseTypeLabel"; this._databaseTypeLabel.Size = new Size(0x7c, 0x10); this._databaseTypeLabel.TabIndex = 0; this._databaseTypeLabel.Text = "Select a database &type:"; this._databaseTypeComboBox.DropDownStyle = ComboBoxStyle.DropDownList; this._databaseTypeComboBox.InitialText = "Select a database type"; this._databaseTypeComboBox.Location = new Point(12, 40); this._databaseTypeComboBox.Name = "_databaseTypeComboBox"; this._databaseTypeComboBox.Size = new Size(0xa4, 0x15); this._databaseTypeComboBox.TabIndex = 1; this._databaseTypeComboBox.SelectedIndexChanged += new EventHandler(this.OnDatabaseTypeComboBoxSelectedIndexChanged); this._infoLabel.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom; this._infoLabel.Location = new Point(12, 0xe8); this._infoLabel.Name = "_infoLabel"; this._infoLabel.Size = new Size(0x188, 60); this._infoLabel.TabIndex = 4; this._infoLabel.Text = ""; this._infoLabel.Visible = false; this._descriptionLabel.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; this._descriptionLabel.Location = new Point(8, 8); this._descriptionLabel.Name = "_descriptionLabel"; this._descriptionLabel.Size = new Size(0x184, 0x2c); this._descriptionLabel.TabStop = false; this._descriptionLabel.Text = "Use the drop-down to select an existing database connection for your query. If you want to create a new database connection, select the <New Database Connection> option in the drop down, select a database type, and click the 'Create' button."; this._createButton.Enabled = false; this._createButton.Location = new Point(180, 40); this._createButton.Name = "_createButton"; this._createButton.TabIndex = 2; this._createButton.Text = "&Create..."; this._createButton.Click += new EventHandler(this.OnCreateButtonClick); base.Caption = "Select a database connection"; base.Controls.Add(this._descriptionLabel); base.Controls.Add(this._infoLabel); base.Controls.Add(this._newDatabaseGroupBox); base.Controls.Add(this._databaseComboBox); base.Controls.Add(this._selectDatabaseLabel); base.Description = "Select an existing database connection or create a new database connection."; base.Name = "UserControl1"; base.Size = new Size(0x1a0, 0x124); this._newDatabaseGroupBox.ResumeLayout(false); base.ResumeLayout(false); }
private void InitializeUserInterface() { this._bottomPanel = new Panel(); this._columnPropertyGrid = new PropertyGrid(); this._verticalSplitter = new Splitter(); this._columnPropertyHelpLabel = new Label(); this._horizontalSplitter = new Splitter(); this._topPanel = new Panel(); this._columnCommandsToolBar = new MxToolBar(); this._moveColumnUpToolBarButton = new MxToolBarButton(); this._moveColumnDownToolBarButton = new MxToolBarButton(); this._deleteColumnToolBarButton = new MxToolBarButton(); this._newColumnToolBarButton = new MxToolBarButton(); this._separator1ToolBarButton = new MxToolBarButton(); this._separator2ToolBarButton = new MxToolBarButton(); this._columnsListView = new MxListView(); this._columnNameColumnHeader = new ColumnHeader(); this._dataTypeColumnHeader = new ColumnHeader(); this._sizeColumnHeader = new ColumnHeader(); this._allowNullsColumnHeader = new ColumnHeader(); this._columnImageList = new ImageList(); this._errorLabel = new MxInfoLabel(); this._bottomPanel.SuspendLayout(); this._topPanel.SuspendLayout(); base.SuspendLayout(); this._errorLabel.Dock = DockStyle.Top; this._errorLabel.Image = MxInfoLabel.ErrorGlyph; this._errorLabel.Location = new Point(0, 0); this._errorLabel.Padding = 2; this._errorLabel.Size = new Size(660, 160); this._errorLabel.Visible = false; this._errorLabel.DoubleClick += new EventHandler(this.OnErrorLabelDoubleClick); this._bottomPanel.BackColor = SystemColors.Control; this._bottomPanel.Controls.AddRange(new Control[] { this._columnPropertyGrid, this._verticalSplitter, this._columnPropertyHelpLabel }); this._bottomPanel.Dock = DockStyle.Bottom; this._bottomPanel.Location = new Point(2, 0xd4); this._bottomPanel.Name = "_bottomPanel"; this._bottomPanel.Size = new Size(660, 200); this._bottomPanel.TabIndex = 0; this._columnPropertyGrid.CommandsVisibleIfAvailable = false; this._columnPropertyGrid.Dock = DockStyle.Fill; this._columnPropertyGrid.HelpVisible = false; this._columnPropertyGrid.LargeButtons = false; this._columnPropertyGrid.LineColor = SystemColors.Control; this._columnPropertyGrid.Name = "_columnPropertyGrid"; this._columnPropertyGrid.PropertySort = PropertySort.Categorized; this._columnPropertyGrid.Size = new Size(0x18d, 200); this._columnPropertyGrid.TabIndex = 5; this._columnPropertyGrid.ToolbarVisible = false; this._columnPropertyGrid.ViewBackColor = SystemColors.Window; this._columnPropertyGrid.ViewForeColor = SystemColors.WindowText; this._columnPropertyGrid.SelectedGridItemChanged += new SelectedGridItemChangedEventHandler(this.OnColumnPropertyGridSelectedGridItemChanged); this._columnPropertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(this.OnColumnPropertyGridPropertyValueChanged); this._verticalSplitter.Dock = DockStyle.Right; this._verticalSplitter.Location = new Point(0x18d, 0); this._verticalSplitter.Name = "_verticalSplitter"; this._verticalSplitter.Size = new Size(3, 200); this._verticalSplitter.TabIndex = 4; this._verticalSplitter.TabStop = false; this._columnPropertyHelpLabel.BorderStyle = BorderStyle.Fixed3D; this._columnPropertyHelpLabel.Dock = DockStyle.Right; this._columnPropertyHelpLabel.ForeColor = Color.Blue; this._columnPropertyHelpLabel.Location = new Point(400, 0); this._columnPropertyHelpLabel.Name = "_columnPropertyHelpLabel"; this._columnPropertyHelpLabel.Size = new Size(260, 200); this._columnPropertyHelpLabel.TabIndex = 3; this._columnPropertyHelpLabel.TextAlign = ContentAlignment.MiddleCenter; this._horizontalSplitter.Dock = DockStyle.Bottom; this._horizontalSplitter.Location = new Point(2, 0xd1); this._horizontalSplitter.Name = "_horizontalSplitter"; this._horizontalSplitter.Size = new Size(660, 3); this._horizontalSplitter.TabIndex = 1; this._horizontalSplitter.TabStop = false; this._topPanel.Controls.AddRange(new Control[] { this._columnsListView, this._columnCommandsToolBar }); this._topPanel.Dock = DockStyle.Fill; this._topPanel.Location = new Point(2, 2); this._topPanel.Name = "_topPanel"; this._topPanel.Size = new Size(660, 0xcf); this._topPanel.TabIndex = 2; this._columnCommandsToolBar.Appearance = ToolBarAppearance.Flat; this._columnCommandsToolBar.Buttons.AddRange(new ToolBarButton[] { this._newColumnToolBarButton, this._separator1ToolBarButton, this._moveColumnUpToolBarButton, this._moveColumnDownToolBarButton, this._separator2ToolBarButton, this._deleteColumnToolBarButton }); this._columnCommandsToolBar.Divider = false; this._columnCommandsToolBar.DropDownArrows = true; this._columnCommandsToolBar.ImageList = this._columnImageList; this._columnCommandsToolBar.Name = "_columnCommandsToolBar"; this._columnCommandsToolBar.ShowToolTips = true; this._columnCommandsToolBar.TabIndex = 5; this._columnCommandsToolBar.TextAlign = ToolBarTextAlign.Right; this._columnCommandsToolBar.Wrappable = false; this._columnCommandsToolBar.ButtonClick += new ToolBarButtonClickEventHandler(this.OnColumnCommandsToolBarButtonClick); this._moveColumnUpToolBarButton.ImageIndex = 2; this._moveColumnUpToolBarButton.ToolTipText = "Move Selected Column Up (Ctrl+Up)"; this._moveColumnDownToolBarButton.ImageIndex = 3; this._moveColumnDownToolBarButton.ToolTipText = "Move Selected Column Down (Ctrl+Down)"; this._deleteColumnToolBarButton.ImageIndex = 5; this._deleteColumnToolBarButton.ToolTipText = "Delete Selected Column (Del)"; this._newColumnToolBarButton.ImageIndex = 4; this._newColumnToolBarButton.Text = "New"; this._newColumnToolBarButton.ToolTipText = "Add New Column (Ins)"; this._separator1ToolBarButton.Style = ToolBarButtonStyle.Separator; this._separator2ToolBarButton.Style = ToolBarButtonStyle.Separator; this._columnsListView.Dock = DockStyle.Fill; this._columnsListView.Columns.AddRange(new ColumnHeader[] { this._columnNameColumnHeader, this._dataTypeColumnHeader, this._sizeColumnHeader, this._allowNullsColumnHeader }); this._columnsListView.FullRowSelect = true; this._columnsListView.HeaderStyle = ColumnHeaderStyle.Nonclickable; this._columnsListView.HideSelection = false; this._columnsListView.LabelEdit = true; this._columnsListView.LabelWrap = false; this._columnsListView.Location = new Point(0, 0x18); this._columnsListView.MultiSelect = false; this._columnsListView.Name = "_columnsListView"; this._columnsListView.Size = new Size(0x292, 0x11a); this._columnsListView.SmallImageList = this._columnImageList; this._columnsListView.TabIndex = 0; this._columnsListView.View = View.Details; this._columnsListView.AfterLabelEdit += new LabelEditEventHandler(this.OnColumnsListViewAfterLabelEdit); this._columnsListView.KeyDown += new KeyEventHandler(this.OnColumnsListViewKeyDown); this._columnsListView.SelectedIndexChanged += new EventHandler(this.OnColumnsListViewSelectedIndexChanged); this._columnNameColumnHeader.Text = "Column Name"; this._columnNameColumnHeader.Width = 200; this._dataTypeColumnHeader.Text = "Data Type"; this._dataTypeColumnHeader.Width = 100; this._sizeColumnHeader.Text = "Size"; this._sizeColumnHeader.Width = 100; this._allowNullsColumnHeader.Text = "Allow Nulls"; this._allowNullsColumnHeader.Width = 0x4b; this._columnImageList.ColorDepth = ColorDepth.Depth8Bit; this._columnImageList.ImageSize = new Size(0x10, 0x10); this._columnImageList.TransparentColor = Color.FromArgb(0xff, 0, 0xff, 0); this._columnImageList.Images.AddStrip(new Bitmap(typeof(TableView), "TableDesignImages.bmp")); this.BackColor = SystemColors.Control; base.ClientSize = new Size(0x298, 0x19e); base.Controls.AddRange(new Control[] { this._topPanel, this._horizontalSplitter, this._bottomPanel, this._errorLabel }); this.Font = new Font("Tahoma", 8f); this._bottomPanel.ResumeLayout(false); this._topPanel.ResumeLayout(false); base.ResumeLayout(false); }
private void SetReadOnly(bool value, string explanation, TableEditState editState) { if (base.Controls[base.Controls.Count - 1] is MxInfoLabel) { base.Controls.RemoveAt(base.Controls.Count - 1); } this._grid.ReadOnly = value; if (explanation.Length > 0) { MxInfoLabel label = new MxInfoLabel(); label.Dock = DockStyle.Top; switch (editState) { case TableEditState.Error: label.Image = MxInfoLabel.ErrorGlyph; break; case TableEditState.Information: label.Image = MxInfoLabel.InfoGlyph; break; case TableEditState.Warning: label.Image = MxInfoLabel.WarningGlyph; break; } label.Padding = 2; label.Text = explanation; base.Controls.Add(label); } }