Skybound VisualTips

IVisualTipExtender Interface

Provides a set of methods for determining the parent and child components of a control.

For a list of all members of this type, see IVisualTipExtender Members.

[Visual Basic]
Public Interface IVisualTipExtender
[C#]
public interface IVisualTipExtender

Remarks

This interface enables you to add VisualTips support to custom controls which do not already provide it.

There are two steps to adding VisualTips support to a custom control. First, create a custom type which implements IVisualTipExtender. Second, invoke SetExtender, passing the System.Type of the custom control and an instance of the type which implements IVisualTipExtender.

The methods of IVisualTipExtender are:

Example

The standard .NET ToolBar control is already supported by VisualTips. However, if you were to implement it manually, your code might look something like this:

[C#]

private class ToolBarExtender : IVisualTipExtender
{
    public object GetChildAtPoint(Control control, int x, int y)
    {
        ToolBar toolbar = control as ToolBar;
        
        foreach (ToolBarButton button in toolbar.Buttons)
        {
            if (button.Rectangle.Contains(x, y))
                return button;
        }
        
        return null;
    }
    
    public object GetParent(object component)
    {
        return (component as ToolBarButton).Parent;
    }
    
    public Type [] GetChildTypes()
    {
        return new Type [] { typeof(ToolBarButton) };
    }
}

Requirements

Namespace: Skybound.VisualTips

Assembly: Skybound.VisualTips (in Skybound.VisualTips.dll)

See Also

IVisualTipExtender Members | Skybound.VisualTips Namespace