public void OnDropStateChange(eDropState state) { if (DropStateChange != null) { DropStateChange(state); } }
protected void OnDropStateChange(eDropState state) { if (DropStateChange != null) { DropStateChange(state); } }
protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); if (_dropState == eDropState.Closing) { _dropState = eDropState.Dropping; } }
public void CloseDropDown() { if (dropContainer != null) { _dropState = eDropState.Closing; dropContainer.DropDownForm.Freeze = false; dropContainer.DropDownForm.Close(); } }
public void InitializeDropDown(Control dropDownItem) { if (_dropDownItem != null) throw new Exception("The drop down item has already been implemented!"); _DesignView = false; _dropState = eDropState.Closed; this.Size = _AnchorSize; this._AnchorClientBounds = new Rectangle(2, 2, _AnchorSize.Width - 21, _AnchorSize.Height - 4); //removes the dropDown item from the controls list so it //won't be seen until the drop-down window is active if (this.Controls.Contains(dropDownItem)) this.Controls.Remove(dropDownItem); _dropDownItem = dropDownItem; }
void dropContainer_Closed(object sender, FormClosedEventArgs e) { if (!dropContainer.DropDownForm.IsDisposed) { dropContainer.DropDownForm.DropStateChange -= dropContainer_DropStateChange; dropContainer.DropDownForm.FormClosed -= dropContainer_Closed; this.ParentForm.Move -= ParentForm_Move; dropContainer.DropDownForm.Dispose(); } dropContainer = null; closedWhileInControl = (this.RectangleToScreen(this.ClientRectangle).Contains(Cursor.Position)); _dropState = eDropState.Closed; this.Invalidate(); }
void DropContainer_Closed(object sender, FormClosedEventArgs e) { if (!_dropContainer.IsDisposed) { _dropContainer.DropStateChange -= DropContainer_DropStateChange; _dropContainer.FormClosed -= DropContainer_Closed; this.ParentForm.Move -= ParentForm_Move; _dropContainer.Dispose(); } _dropContainer = null; _closedWhileInControl = (this.RectangleToScreen(this.ClientRectangle).Contains(Cursor.Position)); _dropState = eDropState.Closed; tmrAnimate.Enabled = false; this.Invalidate(); }
public void InitializeDropDown(Control dropDownItem) { if (_dropDownItem != null) { throw new Exception("The drop down item has already been implemented!"); } _DesignView = false; _dropState = eDropState.Closed; this.Size = _AnchorSize; this._AnchorClientBounds = new Rectangle(2, 2, _AnchorSize.Width - 21, _AnchorSize.Height - 4); //removes the dropDown item from the controls list so it //won't be seen until the drop-down window is active if (this.Controls.Contains(dropDownItem)) { this.Controls.Remove(dropDownItem); } _dropDownItem = dropDownItem; }
public void InitializeDropDown(Control dropDownItem) { if (_dropDownItem != null) { throw new Exception("The drop down item has already been implemented!"); } _designView = false; _dropState = eDropState.Closed; this.Size = _anchorSize; // Removes the dropDown item from the controls list so it // Won't be seen until the drop-down window is active if (this.Controls.Contains(dropDownItem)) { this.Controls.Remove(dropDownItem); } _dropDownItem = dropDownItem; }
public void CloseDropDown() { if (_dropContainer != null) { _dropState = eDropState.Closing; if (_useAnimation) { _dropContainer.Freeze = true; tmrAnimate.Enabled = true; } else { _dropContainer.Freeze = false; _dropContainer.Close(); _dropState = eDropState.Closed; } } }
private void Animate_Tick(object sender, EventArgs e) { int Height = 0; switch (_dropState) { case eDropState.Closing: Height = _dropContainer.Height - _dropDownSize.Height / 10; if (Height < 0) { _dropContainer.Freeze = false; _dropContainer.Close(); _dropState = eDropState.Closed; tmrAnimate.Enabled = false; } else { _dropContainer.Height = Height; } break; case eDropState.Dropping: Height = _dropContainer.Height + _dropDownSize.Height / 10; if (Height >= _dropDownSize.Height) { _dropContainer.Height = _dropDownSize.Height; _dropState = eDropState.Dropped; tmrAnimate.Enabled = false; } else { _dropContainer.Height = Height; } break; case eDropState.Closed: case eDropState.Dropped: default: tmrAnimate.Enabled = false; return; } }
protected void OpenDropDown() { if (_dropDownItem == null) { throw new NotImplementedException("The drop down item has not been initialized! Use the InitializeDropDown() method to do so."); } if (!CanDrop) { return; } dropContainer = new DropDownContainer(_dropDownItem); dropContainer.DropDownForm.Bounds = GetDropDownBounds(); dropContainer.DropDownForm.DropStateChange += new DropDownForm.DropWindowArgs(dropContainer_DropStateChange); dropContainer.DropDownForm.FormClosed += new FormClosedEventHandler(dropContainer_Closed); this.ParentForm.Move += new EventHandler(ParentForm_Move); _dropState = eDropState.Dropping; dropContainer.Show(); _dropState = eDropState.Dropped; this.Invalidate(); }
protected virtual void OpenDropDown() { if (_dropDownItem == null) { return; } //throw new NotImplementedException("The drop down item has not been initialized! Use the InitializeDropDown() method to do so."); if (!CanDrop) { return; } _dropContainer = new DropDownContainer(_dropDownItem, _dropDownSize) { Bounds = GetDropDownBounds() }; _dropContainer.DropStateChange += new DropDownContainer.DropWindowArgs(DropContainer_DropStateChange); _dropContainer.FormClosed += new FormClosedEventHandler(DropContainer_Closed); this.ParentForm.Move += new EventHandler(ParentForm_Move); _dropState = eDropState.Dropping; if (_useAnimation) { tmrAnimate.Enabled = true; _dropContainer.Height = 0; _dropContainer.Show(this); } else { _dropContainer.Show(this); _dropState = eDropState.Dropped; } this.Invalidate(); }
protected void OpenDropDown() { if (_dropDownItem == null) throw new NotImplementedException("The drop down item has not been initialized! Use the InitializeDropDown() method to do so."); if (!CanDrop) return; dropContainer = new DropDownContainer(_dropDownItem); dropContainer.Bounds = GetDropDownBounds(); dropContainer.DropStateChange += new DropDownContainer.DropWindowArgs(dropContainer_DropStateChange); dropContainer.FormClosed += new FormClosedEventHandler(dropContainer_Closed); this.ParentForm.Move += new EventHandler(ParentForm_Move); _dropState = eDropState.Dropping; dropContainer.Show(this); _dropState = eDropState.Dropped; this.Invalidate(); }
void dropContainer_Closed(object sender, FormClosedEventArgs e) { if (!dropContainer.IsDisposed) { dropContainer.DropStateChange -= dropContainer_DropStateChange; dropContainer.FormClosed -= dropContainer_Closed; this.ParentForm.Move -= ParentForm_Move; dropContainer.Dispose(); } dropContainer = null; closedWhileInControl = (this.RectangleToScreen(this.ClientRectangle).Contains(Cursor.Position)); _dropState = eDropState.Closed; this.Invalidate(); }
void dropContainer_DropStateChange(DropDownControl.eDropState state) { _dropState = state; }
protected void OnDropStateChange(eDropState state) { if (DropStateChange != null) DropStateChange(state); }
private void dropContainer_DropStateChange(eDropState state) { _dropState = state; }
private void OnDropStateChange(eDropState state) { DropStateChange?.Invoke(state); }
public void CloseDropDown() { if (dropContainer != null) { _dropState = eDropState.Closing; dropContainer.Freeze = false; dropContainer.Close(); } }