This documentation is archived and is not being maintained.

IToolboxUser.GetToolSupported Method

Gets a value indicating whether the specified tool is supported by the current designer.

Namespace:  System.Drawing.Design
Assembly:  System.Drawing (in System.Drawing.dll)

bool GetToolSupported(
	ToolboxItem tool


Type: System.Drawing.Design.ToolboxItem
The ToolboxItem to be tested for toolbox support.

Return Value

Type: System.Boolean
true if the tool is supported by the toolbox and can be enabled; false if the document designer does not know how to use the tool.

If the specified tool is supported by the designer implementing the IToolboxUser interface, then the tool will be enabled in the toolbox when this designer has focus. Otherwise, it will be disabled. Once a tool is marked as enabled or disabled, it may not be tested for support with the same designer again.

The following code example demonstrates an implementation of the GetToolSupported method.

// This method can signal whether to enable or disable the specified
// ToolboxItem when the component associated with this designer is selected.
bool IToolboxUser.GetToolSupported(ToolboxItem tool)
    // Search the blocked type names array for the type name of the tool
    // for which support for is being tested. Return false to indicate the
    // tool should be disabled when the associated component is selected.
    for( int i=0; i<blockedTypeNames.Length; i++ )
        if( tool.TypeName == blockedTypeNames[i] )
            return false;

    // Return true to indicate support for the tool, if the type name of the
    // tool is not located in the blockedTypeNames string array.
    return true;

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.