Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinToolbars
Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
Debug.WriteLine("Tool property values")
Debug.IndentLevel += 1
Dim toolbar As UltraToolbar
For Each toolbar In Me.UltraToolbarsManager1.Toolbars
Debug.WriteLine("Toolbar '" + toolbar.Key + "' tool info -----------------------")
Debug.IndentLevel += 1
Me.ProcessToolsCollection(toolbar.Tools)
Debug.IndentLevel -= 1
Next
Debug.IndentLevel -= 1
End Sub
Private Sub ProcessToolsCollection(ByVal tools As ToolsCollection)
Dim tool As ToolBase
For Each tool In tools
Debug.IndentLevel += 1
' すべてのツールの共有プロパティを表示します (ToolBase から継承します)
Debug.WriteLine("Tool #" + tool.Index.ToString() + " (Key: " + tool.Key + ") is a " + tool.GetType().Name.ToString())
Debug.IndentLevel += 1
Debug.WriteLine("Its default size is: " + tool.DefaultSize.ToString())
Debug.WriteLine("Its minimum size is: " + tool.MinimumSize.ToString())
If tool.IsControlContainer = True Then
Debug.WriteLine("It IS a control container")
Else
Debug.WriteLine("It is NOT a control container")
End If
If tool.CanActivate = True Then
Debug.WriteLine("It CAN be activated")
Else
Debug.WriteLine("It CANNOT be activated")
End If
If tool.ShouldDisplayToolTip = True Then
Debug.WriteLine("It WILL display a tooltip if available")
Else
Debug.WriteLine("It will NOT display a tooltip")
End If
If Not tool.Control Is Nothing Then
Debug.WriteLine("Its associated control is of type: " + tool.Control.GetType().Name)
End If
If Not tool.AttachedParentTool Is Nothing Then
Debug.WriteLine("Its AttachedParentTool has a key of: " + tool.AttachedParentTool.Key)
End If
If tool.InstanceDisplaysImage = True Then
Debug.WriteLine("It WILL display an image if one has been assigned")
Else
Debug.WriteLine("It will NOT display an image")
End If
If tool.InstanceDisplaysText = True Then
Debug.WriteLine("It WILL display text if assigned")
Else
Debug.WriteLine("It will NOT display text")
End If
Debug.WriteLine("Its Height is: " + tool.Height.ToString())
Debug.IndentLevel -= 1
Debug.IndentLevel -= 1
Next
End Sub