IToolboxUser.GetToolSupported(ToolboxItem) IToolboxUser.GetToolSupported(ToolboxItem) IToolboxUser.GetToolSupported(ToolboxItem) IToolboxUser.GetToolSupported(ToolboxItem) Method

정의

지정된 된 도구의 현재 디자이너에서 지원 되는지 여부를 나타내는 값을 가져옵니다.Gets a value indicating whether the specified tool is supported by the current designer.

public:
 bool GetToolSupported(System::Drawing::Design::ToolboxItem ^ tool);
public bool GetToolSupported (System.Drawing.Design.ToolboxItem tool);
abstract member GetToolSupported : System.Drawing.Design.ToolboxItem -> bool
Public Function GetToolSupported (tool As ToolboxItem) As Boolean

매개 변수

tool
ToolboxItem ToolboxItem ToolboxItem ToolboxItem

ToolboxItem 도구 상자 지원에 대 한 테스트 수입니다.The ToolboxItem to be tested for toolbox support.

반환

true 도구를 도구 상자에서 지원 되 고 사용할 수 있습니다; 경우 false 문서 디자이너 도구를 사용 하는 방법을 모르면 합니다.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.

예제

다음 코드 예제에서는의 구현을 보여 줍니다는 GetToolSupported 메서드.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;
}


// 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;
}
' This method can signal whether to enable or disable the specified
' ToolboxItem when the component associated with this designer is selected.
Function GetToolSupported(ByVal tool As ToolboxItem) As Boolean Implements IToolboxUser.GetToolSupported
    ' 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.
    Dim i As Integer
    For i = 0 To blockedTypeNames.Length - 1
        If tool.TypeName = blockedTypeNames(i) Then
            Return False
        End If
    Next i ' 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
End Function

설명

지정된 된 도구는 디자이너를 구현 하 여 지원 되는 경우는 IToolboxUser 인터페이스를이 디자이너에 포커스가 있을 때 도구 상자에서 도구를 사용 합니다.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.

적용 대상

추가 정보