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
boolean GetToolSupported (
	ToolboxItem tool
function GetToolSupported (
	tool : ToolboxItem
) : boolean
Not applicable.



The ToolboxItem to be tested for toolbox support.

Return Value

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;

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions