protected override void Click(int yOffset, int parentWidth) { if (this.Enabled) { if (this.EditControl != null) { this.EditControl.Focus(); this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name)); } else { base.DisableEvents = true; DVComboBox control = base.Parent.GetControl(typeof(DVComboBox)) as DVComboBox; if (control != null) { control.ComboBox.BeginInit(); control.Font = base.TextFont; control.ComboBox.DropDownStyle = this.DropDownStyle; control.Enabled = true; if ((this.DataManager != null) && (this.DataManager.Count == 0)) { control.ComboBox.ValueMember = ""; control.ComboBox.DisplayMember = ""; control.ComboBox.DataSource = new object[0]; } else { control.ComboBox.ValueMember = this.ValueMember; control.ComboBox.DisplayMember = this.DisplayMember; control.ComboBox.DataSource = this.DataSource; } control.ComboBox.SelectedIndex = this.SelectedIndex; control.Text = this.Text; control.ComboBox.MaxLength = this.MaxLength; control.ValueChanged = (EventHandler)Delegate.Combine(control.ValueChanged, new EventHandler(this.OnControlChanged)); control.ComboBox.EndInit(); this.EditControl = control; control.Bounds = this.GetActivePartBounds(yOffset); base.DisableEvents = false; this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name)); base.DisableEvents = true; if (this.EditControl != null) { this.EditControl.Show(); if (this.DropDownClicked(parentWidth, yOffset)) { this.EditControl.ComboBox.DroppedDown = true; } } } base.DisableEvents = false; base.Click(yOffset, parentWidth); } } }
protected override void Hide() { if (this.EditControl != null) { this.EditControl.ValueChanged = (EventHandler)Delegate.Remove(this.EditControl.ValueChanged, new EventHandler(this.OnControlChanged)); int selectedIndex = this.EditControl.ComboBox.SelectedIndex; string text = this.EditControl.Text; this.SelectedIndex = selectedIndex; this.Text = text; base.Hide(); this.EditControl.Hide(); } else { base.Hide(); } this.EditControl = null; }
protected override void Hide() { if (this.EditControl != null) { this.EditControl.ValueChanged = (EventHandler) Delegate.Remove(this.EditControl.ValueChanged, new EventHandler(this.OnControlChanged)); int selectedIndex = this.EditControl.ComboBox.SelectedIndex; string text = this.EditControl.Text; this.SelectedIndex = selectedIndex; this.Text = text; base.Hide(); this.EditControl.Hide(); } else { base.Hide(); } this.EditControl = null; }
protected override void Click(int yOffset, int parentWidth) { if (this.Enabled) { if (this.EditControl != null) { this.EditControl.Focus(); this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name)); } else { base.DisableEvents = true; DVComboBox control = base.Parent.GetControl(typeof(DVComboBox)) as DVComboBox; if (control != null) { control.ComboBox.BeginInit(); control.Font = base.TextFont; control.ComboBox.DropDownStyle = this.DropDownStyle; control.Enabled = true; if ((this.DataManager != null) && (this.DataManager.Count == 0)) { control.ComboBox.ValueMember = ""; control.ComboBox.DisplayMember = ""; control.ComboBox.DataSource = new object[0]; } else { control.ComboBox.ValueMember = this.ValueMember; control.ComboBox.DisplayMember = this.DisplayMember; control.ComboBox.DataSource = this.DataSource; } control.ComboBox.SelectedIndex = this.SelectedIndex; control.Text = this.Text; control.ComboBox.MaxLength = this.MaxLength; control.ValueChanged = (EventHandler) Delegate.Combine(control.ValueChanged, new EventHandler(this.OnControlChanged)); control.ComboBox.EndInit(); this.EditControl = control; control.Bounds = this.GetActivePartBounds(yOffset); base.DisableEvents = false; this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name)); base.DisableEvents = true; if (this.EditControl != null) { this.EditControl.Show(); if (this.DropDownClicked(parentWidth, yOffset)) { this.EditControl.ComboBox.DroppedDown = true; } } } base.DisableEvents = false; base.Click(yOffset, parentWidth); } } }