IToolboxUser.GetToolSupported(ToolboxItem) 메서드

정의

현재 디자이너에서 지정된 도구를 지원하는지 여부를 나타내는 값을 가져옵니다.

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입니다.

반환

도구 상자에서 해당 도구를 지원하며 도구를 활성화할 수 있으면 true이고 문서 디자이너에서 도구 사용 방법을 알지 못하면 false입니다.

예제

다음 코드 예제에서는의 구현을 보여 줍니다는 GetToolSupported 메서드.

// 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 디자이너에서 지원되는 경우 이 디자이너에 포커스가 있을 때 도구 상자에서 도구가 사용하도록 설정됩니다. 그렇지 않으면 사용하지 않도록 설정됩니다. 도구가 사용 또는 사용 안 함으로 표시되면 동일한 디자이너에서 지원을 다시 테스트하지 않을 수 있습니다.

적용 대상

추가 정보