public SettingsDialog() { Color = new Color[Colors.Count]; Regions = Settings.Regions; InitializeComponent(); editBox = new TextBox { Location = new Point(0, 0), Size = new Size(0, 0), Font = new Font("Tahoma", 8.25f), AcceptsReturn = true }; editBox.Hide(); m_RegionListing.Controls.AddRange(new Control[] { editBox }); editBox.Text = string.Empty; editBox.BorderStyle = BorderStyle.FixedSingle; editBox.KeyPress += editBoxKeyPress; editBox.LostFocus += focusOver; editBox.Enter += editBoxEnter; editBox.Leave += editBoxLeave; m_colorListBox.DrawMode = DrawMode.OwnerDrawFixed; m_colorListBox.DrawItem += ColorListBox_DrawItem; m_colorListBox.SelectedIndex = 0; addRegionsToListbox(); m_RegionListing.DrawMode = DrawMode.OwnerDrawFixed; m_RegionListing.DrawItem += RegionListBox_DrawItem; m_RegionListing.SelectedIndex = 0; }
public keywordScheme_Element() { // Configure the keyword box thisKeywordBox = new TextBox(); thisKeywordBox.Location = new Point( 115, 2 ); thisKeywordBox.BackColor = Color.White; thisKeywordBox.TextChanged += new EventHandler(thisKeywordBox_TextChanged); thisKeywordBox.Enter += new EventHandler(textBox_Enter); thisKeywordBox.Leave += new EventHandler(textBox_Leave); thisKeywordBox.ForeColor = System.Drawing.Color.MediumBlue; this.Controls.Add( thisKeywordBox ); // Configure the scheme box /// thisSchemeBox = new FlatComboBox(); thisSchemeBox = new ComboBox(); thisSchemeBox.Width = 110; thisSchemeBox.Location = new Point( this.Width - thisSchemeBox.Width - 50, 2 ); thisSchemeBox.TextChanged +=new EventHandler(thisSchemeBox_TextChanged); thisSchemeBox.Enter += new EventHandler(thisSchemeBox_Enter); thisSchemeBox.Leave += new EventHandler(thisSchemeBox_Leave); thisSchemeBox.ForeColor = System.Drawing.Color.MediumBlue; this.Controls.Add( thisSchemeBox ); // Configure the scheme box, but leave it hidden readonlySchemeBox = new TextBox(); readonlySchemeBox.Location = thisSchemeBox.Location; readonlySchemeBox.Width = 110; readonlySchemeBox.Hide(); readonlySchemeBox.BackColor = Color.WhiteSmoke; readonlySchemeBox.ReadOnly = true; readonlySchemeBox.Enter += new EventHandler(textBox_Enter); readonlySchemeBox.Leave += new EventHandler(textBox_Leave); readonlySchemeBox.ForeColor = System.Drawing.Color.MediumBlue; this.Controls.Add( readonlySchemeBox ); // Set default title to blank title = "no default"; scheme = "Scheme"; scheme_length = 50; if (!DLC.Tools.Windows_Appearance_Checker.is_XP_Theme) { thisSchemeBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; thisKeywordBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; readonlySchemeBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; isXP = false; } else { isXP = true; } }
public override void DrawControls() { InitDatabase(); if (!isEmptyCriterions) { isEmptyCriterions = ShowQuery("Выполнить обновление номенклатуры и критериев оценивания?"); } if (isEmptyCriterions) { if (!UpdateRules()) { throw new ConnectionIsNotExistsException("нужно обновить критерии оценивания и номенклатуру!"); } } MainProcess.ClearControls(); MainProcess.ToDoCommand = "Регистрация качества"; labelControl = (MainProcess.CreateLabel("", 5, 59, 229, 39, ControlsStyle.LabelMultilineSmall).GetControl()) as Label; textBoxControl = (MainProcess.CreateTextBox(0, 0, 0, "", ControlsStyle.LabelH2, onTextBoxEndEdit, false)).GetControl() as TextBox; textBoxControl.LostFocus += new EventHandler(textBoxControl_LostFocus); textBoxControl.Hide(); Nomenclature = ""; #region Создание рабочей таблицы var dataTable = new DataTable(); dataTable.Columns.AddRange(new DataColumn[] { new DataColumn("CriterionName", typeof(string)), new DataColumn("CriterionId", typeof(long)), new DataColumn("Mark", typeof(int)), new DataColumn("HaveSubCriterion", typeof(bool)), new DataColumn("ParentCriterionId", typeof(long)) }); #endregion table = MainProcess.CreateTable("operations", 217, 99, onRowSelected); table.DT = dataTable; table.AddColumn("Критерий", "CriterionName", 180); table.AddColumn("Балл", "Mark", 34); table.Focus(); }
public override bool Execute() { TextBox txtNewName = new TextBox(); txtNewName.BackColor = Color.Yellow; txtNewName.Parent = txt; txtNewName.Location = txt.GetPositionFromCharIndex(root.StartPosInRootScope); txtNewName.AutoSize = true; txt.Controls.Add(txtNewName); bool shouldChangeName = true; EventHandler ChangeNameHandler = delegate { if (shouldChangeName) { root.Name = txtNewName.Text; } txtNewName.Hide(); txtNewName.Parent = null; txt.Controls.Remove(txtNewName); txt.TriggerExpressionChanged(); txt.Invalidate(root); }; txtNewName.LostFocus += ChangeNameHandler; txtNewName.KeyDown += delegate(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { ChangeNameHandler(txtNewName, EventArgs.Empty); } if (e.KeyCode == Keys.Escape) { shouldChangeName = false; ChangeNameHandler(txtNewName, EventArgs.Empty); } }; txtNewName.Text = root.Name; txtNewName.Visible = true; txtNewName.Focus(); txtNewName.SelectAll(); return true; }
public ListViewEx() { editBox = new System.Windows.Forms.TextBox(); this.EditFont = this.Font; this.EditBgColor = Color.LightBlue; this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.SMKMouseDown); this.GridLines = true; editBox.Size = new System.Drawing.Size(0, 0); editBox.Location = new System.Drawing.Point(0, 0); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.editBox }); editBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.EditOver); editBox.LostFocus += new System.EventHandler(this.FocusOver); editBox.AutoSize = true; editBox.Font = this.EditFont; editBox.BackColor = this.EditBgColor; editBox.BorderStyle = BorderStyle.FixedSingle; editBox.Hide(); editBox.Text = ""; }
private void DrawDataGridView() { DataGridView dataGridView = new DataGridView(); dataGridView.ScrollBars = ScrollBars.Both; dataGridView.AutoSize = true; dataGridView.AllowUserToAddRows = false; dataGridView.AllowUserToDeleteRows = false; dataGridView.AllowUserToResizeRows = false; dataGridView.Dock = DockStyle.Fill; dataGridView.BackgroundColor = SystemColors.Control; dataGridView.BorderStyle = BorderStyle.None; dataGridView.ReadOnly = true; dataGridView.AllowUserToAddRows = false; dataGridView.RowHeadersVisible = false; dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dataGridView.DoubleClick += new EventHandler(dataGridView_DoubleClick); dataGridView.KeyDown += new KeyEventHandler(dataGridView_KeyDown); dataGridView.ColumnHeadersHeight = 40; //设置DataGridView的数据源 Form frmDataSource = new Form(); frmDataSource.Controls.Add(dataGridView); frmDataSource.SuspendLayout(); dataGridViewHost = new ToolStripControlHost(dataGridView); dataGridViewHost.AutoSize = m_blPopupAutoSize; TextBox textBox = new TextBox(); textBox.TextChanged += new EventHandler(textBox_TextChanged); textBox.KeyDown += new KeyEventHandler(textBox_KeyDown); textBox.Hide(); textBoxHost = new ToolStripControlHost(textBox); dropDown = new ToolStripDropDown(); dropDown.Items.Add(textBoxHost); dropDown.Items.Add(dataGridViewHost); }
private void Form1_Load(object sender, EventArgs e) { Program.engine.setComponent(typeof(IIconProducer), new IconQueue()); IconGetter.RunWorkerAsync(); console = ConfigSelector.createConsole(); console.Hide(); Font font = ConfigSelector.Font; if (font != null) Program.engine.Font = font; demoFlowPanel1.Controls.Add(console); // consoleTextBox1.engine = Program.engine; browser = Program.engine.getComponent<IBrowser>(); browser.DirectoryChanged += new EventHandler(browser_onChangeDirectory); browserPanel.PageService = browser; browser.CursorChanged += new EventHandler(browserPanel.onCursorChanged); browser.CurrentDir = new DirectoryInfo(Directory.GetCurrentDirectory()); Program.engine.UINotify += new EventHandler<Engine.Notification.NotifyArgs>(onEngineNotification); m_demoFlowPanelTimer = new Timer(); m_demoFlowPanelTimer.Interval = 100; m_demoFlowPanelTimer.Tick += new EventHandler(m_demoFlowPanelTimer_Tick); m_demoFlowPanelTimer.Start(); }
/// <summary> /// Set the member variables to default values. Intended only for use in constructors and deserialization code. /// </summary> protected virtual void SetMemberVariablesToDefault() { m_DeserializationSurrogate=null; m_Table=null; m_TableLayout=null; m_View = null; // The main menu of this controller. m_MainMenu = null; m_MenuItemEditRemove = null; m_MenuItemColumnSetColumnValues = null; // Which selection was done last: selection (i) a data column, (ii) a data row, or (iii) a property column.</summary> m_LastSelectionType = SelectionType.Nothing; // holds the positions (int) of the right boundarys of the __visible__ (!) columns m_ColumnStyleCache = new ColumnStyleCache(); // Horizontal scroll position; number of first column that is shown. m_HorzScrollPos=0; // Vertical scroll position; Positive values: number of first data column m_VertScrollPos=0; m_HorzScrollMax=1; m_VertScrollMax=1; m_LastVisibleColumn=0; m_LastFullyVisibleColumn=0; // Holds the indizes to the selected data columns. m_SelectedDataColumns = new Altaxo.Worksheet.IndexSelection(); // holds the selected columns // Holds the indizes to the selected rows. m_SelectedDataRows = new Altaxo.Worksheet.IndexSelection(); // holds the selected rows // Holds the indizes to the selected property columns. m_SelectedPropertyColumns = new Altaxo.Worksheet.IndexSelection(); // holds the selected property columns // Holds the indizes to the selected property columns. m_SelectedPropertyRows = new Altaxo.Worksheet.IndexSelection(); // holds the selected property columns // Cached number of table rows. m_NumberOfTableRows=0; // cached number of rows of the table // Cached number of table columns. m_NumberOfTableCols=0; // Cached number of property columns. m_NumberOfPropertyCols=0; // cached number of property columnsof the table m_MouseDownPosition = new Point(0,0); // holds the position of a double click m_DragColumnWidth_ColumnNumber=int.MinValue; // stores the column number if mouse hovers over separator m_DragColumnWidth_OriginalPos = 0; m_DragColumnWidth_OriginalWidth=0; m_DragColumnWidth_InCapture=false; m_CellEdit_IsArmed=false; m_CellEdit_EditedCell = new ClickedCellInfo(); m_CellEditControl = new System.Windows.Forms.TextBox(); m_CellEditControl.AcceptsTab = true; m_CellEditControl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; m_CellEditControl.Location = new System.Drawing.Point(392, 0); m_CellEditControl.Multiline = true; m_CellEditControl.Name = "m_CellEditControl"; m_CellEditControl.TabIndex = 0; m_CellEditControl.Text = ""; m_CellEditControl.Hide(); m_CellEdit_IsArmed = false; m_CellEditControl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnCellEditControl_KeyDown); m_CellEditControl.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.OnCellEditControl_KeyPress); //m_View.TableViewWindow.Controls.Add(m_CellEditControl); }
public codeStatement_Element( string defaultTitle ) { // Configure the code box // thisCodeBox = new FlatComboBox(); thisCodeBox = new ComboBox(); thisCodeBox.Location = new Point( 115, 2 ); thisCodeBox.Width = 100; thisCodeBox.TextChanged +=new EventHandler(thisCodeBox_TextChanged); thisCodeBox.Sorted = true; thisCodeBox.Enter += new EventHandler(thisCodeBox_Enter); thisCodeBox.Leave += new EventHandler(thisCodeBox_Leave); thisCodeBox.ForeColor = System.Drawing.Color.MediumBlue; this.Controls.Add( thisCodeBox ); // Configure the code box, but leave it hidden readonlyCodeBox = new TextBox(); readonlyCodeBox.Location = new Point( 115, 2 ); readonlyCodeBox.Width = 100; readonlyCodeBox.Hide(); readonlyCodeBox.BackColor = Color.WhiteSmoke; readonlyCodeBox.ReadOnly = true; readonlyCodeBox.Enter += new EventHandler(textBox_Enter); readonlyCodeBox.Leave += new EventHandler(textBox_Leave); readonlyCodeBox.ForeColor = System.Drawing.Color.MediumBlue; this.Controls.Add( readonlyCodeBox ); // Configure the statement box thisStatementBox = new TextBox(); thisStatementBox.Location = new Point( 240, 2 ); thisStatementBox.BackColor = Color.White; thisStatementBox.TextChanged += new EventHandler(thisStatementBox_TextChanged); thisStatementBox.Enter += new EventHandler(textBox_Enter); thisStatementBox.Leave += new EventHandler(textBox_Leave); thisStatementBox.ForeColor = System.Drawing.Color.MediumBlue; this.Controls.Add( thisStatementBox ); // Save the title title = defaultTitle; if (!DLC.Tools.Windows_Appearance_Checker.is_XP_Theme) { thisCodeBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; thisStatementBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; readonlyCodeBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; isXP = false; } else { isXP = true; } }
private void FocusOver(object sender, System.EventArgs e) { this.jvmOptionsListBox.Items[this.itemSelected] = editBox.Text; editBox.Hide(); }
private LabeledMultiStringControl ReplaceTextBoxWithMultiStringBox(TextBox tb, IVwStylesheet stylesheet) { Debug.Assert(Cache != null, "Need a cache to setup a MultiStringBox."); tb.Hide(); if (m_uiWss.Count == 0) return null; var ms = new LabeledMultiStringControl(Cache, m_uiWss, stylesheet); ms.Location = tb.Location; ms.Width = tb.Width; ms.Anchor = tb.Anchor; ms.AccessibleName = tb.AccessibleName; // Grow the dialog and move all lower controls down to make room. Controls.Remove(tb); ms.TabIndex = tb.TabIndex; // assume the same tab order as the 'designed' control Controls.Add(ms); FontHeightAdjuster.GrowDialogAndAdjustControls(this, ms.Height - tb.Height, ms); return ms; }
private void initEditTextBox() { editBox = new System.Windows.Forms.TextBox(); editBox.Location = new System.Drawing.Point(0, 0); editBox.Size = new System.Drawing.Size(0, 0); editBox.Hide(); editBox.Text = ""; editBox.BackColor = Color.Beige; editBox.Font = new Font("宋体", 15, FontStyle.Regular | FontStyle.Underline, GraphicsUnit.Pixel); editBox.ForeColor = Color.Blue; editBox.BorderStyle = BorderStyle.FixedSingle; editBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.EditOver); editBox.LostFocus += new System.EventHandler(this.FocusOver); }
private void FocusOver(object sender, System.EventArgs e) { listBox1.Items[itemSelected] = editBox.Text; editBox.Hide(); }
/// <summary> /// Handles the edit change when the focus gets lost /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FocusOver(object sender, System.EventArgs e) { currentListItem.SubItems[subItemSelected].Text = editBox.Text; editBox.Hide(); RaiseAfterTaskChanged(GetTask(currentListItem.Index)); }
private void Form1_Load(object sender, EventArgs e) { console = Config.ConfigSelector.Console; console.Hide(); Font font = Config.ConfigSelector.Font; if (font != null) Program.engine.Font = font; demoFlowPanel1.Controls.Add(console); // consoleTextBox1.engine = Program.engine; browser = Program.engine.Browser; browser.onChangeDirectory += new EventHandler(browser_onChangeDirectory); browserPanel.PageService = browser; browser.onChangeCursor += new EventHandler(browserPanel.onCursorChanged); browser.CurrentDir = new DirectoryInfo(Directory.GetCurrentDirectory()); Timer timer = new Timer(); timer.Interval = 1000; timer.Tick += new EventHandler(timer_Tick); timer.Start(); }
private void SetupEditBox() { editBox = new System.Windows.Forms.TextBox(); editBox.BackColor = Color.LightYellow; editBox.BorderStyle = BorderStyle.Fixed3D; editBox.Location = new System.Drawing.Point(0, 0); editBox.Size = new System.Drawing.Size(0, 0); editBox.Text = ""; editBox.LostFocus += new EventHandler(editBox_LostFocus); editBox.KeyPress += new KeyPressEventHandler(editBox_KeyPress); Controls.AddRange(new System.Windows.Forms.Control[] { this.editBox }); editBox.Hide(); }
void SetVisible() { System.Windows.Forms.TextBox txt = new System.Windows.Forms.TextBox(); this.Controls.Add(txt); txt.Hide(); }