/// <summary> /// Determins if the specified value is allowed. /// </summary> /// <param name="context">The context of the value.</param> /// <param name="value">The value to which to set the property</param> /// <returns><c>true</c> if the given value is a <see cref="VerticalTabPage"/> /// in the <see cref="VerticalTabControl"/>; <c>false</c> otherwise.</returns> protected override bool IsValueAllowed(ITypeDescriptorContext context, object value) { if (context != null) { VerticalTabControl vtcTabControl = (VerticalTabControl)context.Instance; return(vtcTabControl.TabPages.Contains((VerticalTabPage)value)); } return(false); }
/// <summary> /// Determines of the control should respond to a mouse click. /// </summary> /// <param name="point">The point where the mouse was clicked.</param> /// <returns><c>true</c> if the designed control should process the mouse click; /// <c>false</c> otherwise.</returns> protected override bool GetHitTest(Point point) { VerticalTabControl vtcTabControl = (VerticalTabControl)Control; foreach (VerticalTabPage vtpPage in vtcTabControl.TabPages) { if (vtpPage.TabButton.Button.ClientRectangle.Contains(vtpPage.TabButton.Button.PointToClient(point))) { return(true); } } return(false); }