Exemple #1
0
 /// <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="DropDownTabPage"/>
 /// in the <see cref="DropDownTabControl"/>; <c>false</c> otherwise.</returns>
 protected override bool IsValueAllowed(ITypeDescriptorContext context, object value)
 {
     if (context != null)
     {
         DropDownTabControl ddtTabControl = (DropDownTabControl)context.Instance;
         return(ddtTabControl.TabPages.Contains((DropDownTabPage)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)
        {
            DropDownTabControl ddtTabControl = (DropDownTabControl)Control;

            return(ddtTabControl.TabSelector.ClientRectangle.Contains(ddtTabControl.TabSelector.PointToClient(point)));
        }