protected override Object CreateInstance(Type ItemType) { JPictureBox xpanderPanel = (JPictureBox)base.CreateInstance(ItemType); if (this.Context.Instance != null) { //xpanderPanel.Expand = true; } return(xpanderPanel); }
int IList.Add(object value) { JPictureBox xpanderPanel = value as JPictureBox; if (xpanderPanel == null) { throw new ArgumentException(); } this.Add(xpanderPanel); return(this.IndexOf(xpanderPanel)); }
protected override void OnControlRemoved(System.Windows.Forms.ControlEventArgs e) { base.OnControlRemoved(e); JPictureBox xpanderPanel = e.Control as JPictureBox; if (xpanderPanel != null) { xpanderPanel.DeleteClick -= new EventHandler(xpanderPanel_DeleteClick); xpanderPanel.SelectClick -= new EventHandler(xpanderPanel_SelectClick); } OnResize(EventArgs.Empty); }
private void xpanderPanel_SelectClick(object sender, EventArgs e) { foreach (JPictureBox item in this._Items) { if (item != (sender as JPictureBox)) { item.IsFoucs = false; } else { _SelectedItem = item; if (SelectItemChanged != null) { SelectItemChanged(sender, e); } } } }
protected override void OnControlAdded(System.Windows.Forms.ControlEventArgs e) { base.OnControlAdded(e); JPictureBox xpanderPanel = e.Control as JPictureBox; if (xpanderPanel != null) { xpanderPanel.Parent = this; xpanderPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); xpanderPanel.Width = (Width - this.Padding.Left - this.Padding.Right - 6) / _ZCount; xpanderPanel.Height = _ZHeight; xpanderPanel.Location = this.GetTopPosition(0); xpanderPanel.DeleteClick += new EventHandler(xpanderPanel_DeleteClick); xpanderPanel.SelectClick += new EventHandler(xpanderPanel_SelectClick); } else { throw new InvalidOperationException("只能添加JPictureBox对象"); } }
/// <summary> /// Removes the first occurrence of a specific XPanderPanel from the XPanderPanelCollection /// </summary> /// <param name="value">The XPanderPanel to remove from the XPanderPanelCollection</param> public void Remove(JPictureBox xpanderPanel) { this.m_controlCollection.Remove(xpanderPanel); }
/// <summary> /// Adds a XPanderPanel to the collection. /// </summary> /// <param name="xpanderPanel">The XPanderPanel to add.</param> public void Add(JPictureBox xpanderPanel) { this.m_controlCollection.Add(xpanderPanel); this.m_xpanderPanelList.Invalidate(); }
/// <summary> /// Determines whether the XPanderPanelCollection contains a specific XPanderPanel /// </summary> /// <param name="value">The XPanderPanel to locate in the XPanderPanelCollection</param> /// <returns>true if the XPanderPanelCollection contains the specified value; otherwise, false.</returns> public bool Contains(JPictureBox xpanderPanel) { return(this.m_controlCollection.Contains(xpanderPanel)); }
/// <summary> /// Inserts an XPanderPanel to the collection at the specified index. /// </summary> /// <param name="index">The zero-based index at which value should be inserted. </param> /// <param name="xpanderPanel">The XPanderPanel to insert into the Collection.</param> public void Insert(int index, JPictureBox xpanderPanel) { ((IList)this).Insert(index, (object)xpanderPanel); }
/// <summary> /// Returns the index of the specified XPanderPanel in the collection. /// </summary> /// <param name="xpanderPanel">The xpanderPanel to find the index of.</param> /// <returns>The index of the xpanderPanel, or -1 if the xpanderPanel is not in the <see ref="ControlCollection">ControlCollection</see> instance.</returns> public int IndexOf(JPictureBox xpanderPanel) { return(this.m_controlCollection.IndexOf(xpanderPanel)); }