Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinToolbars
PrivateSub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
Debug.WriteLine("Properties of all currently defined toolbars ------------------------")
Debug.IndentLevel += 1
Dim toolbar As UltraToolbar
ForEach toolbar InMe.UltraToolbarsManager1.Toolbars
If toolbar IsNothingThenGoTo NextToolbar
EndIf
Debug.WriteLine("Toolbar '" + toolbar.Key + "'")
Debug.IndentLevel += 1
' ツールバーの DockedColumn、DockedRow、DockedPosition、FloatingLocation、および
' FloatingSize プロパティをアクセスします
SelectCase toolbar.DockedPosition
Case DockedPosition.Floating
Dim rectFloating AsNew Rectangle(toolbar.FloatingLocation, toolbar.FloatingSize)
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is floating. Its position and size are: " + rectFloating.ToString())
Case DockedPosition.Top
Case DockedPosition.Bottom
Case DockedPosition.Left
Case DockedPosition.Right
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is docked in position '" + toolbar.DockedPosition.ToString() + "'. Its DockedRow is: " + toolbar.DockedRow.ToString() + ", and its DockedColumn is: " + toolbar.DockedColumn.ToString())
EndSelect' ツールバーの Index プロパティにアクセスします
Debug.WriteLine("Toolbar '" + toolbar.Key + "' has an Index in its parent collection of: " + toolbar.Index.ToString())
' ツールバーの IsMainMenuBar プロパティにアクセスします
If toolbar.IsMainMenuBar = TrueThen
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is a main menu bar!")
Else
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is NOT a main menu bar!")
EndIf' ツールバーの IsStockToolbar プロパティにアクセスします
If toolbar.IsStockToolbar = TrueThen
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is a stock toolbar!")
Else
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is NOT a stock toolbar!")
EndIf' ツールバーの ParentCollection プロパティにアクセスします
IfNot toolbar.ParentCollection IsNothingThen
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is in a collection that contains a total of " + toolbar.ParentCollection.Count.ToString() + " entries")
EndIf' ツールバーの ShowInToolbarList プロパティにアクセスします
If toolbar.ShowInToolbarList = TrueThen
Debug.WriteLine("Toolbar '" + toolbar.Key + "' will appear in the toolbar list")
Else
Debug.WriteLine("Toolbar '" + toolbar.Key + "' will NOT appear in the toolbar list!")
EndIf
Debug.IndentLevel -= 1
NextToolbar:
Next
Debug.IndentLevel -= 1
End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinToolbars;
privatevoid button16_Click(object sender, System.EventArgs e)
{
Debug.WriteLine("Properties of all currently defined toolbars ------------------------");
Debug.IndentLevel++;
foreach(UltraToolbar toolbar inthis.ultraToolbarsManager1.Toolbars)
{
if (toolbar == null)
continue;
Debug.WriteLine("Toolbar '" + toolbar.Key + "'");
Debug.IndentLevel ++;
// ツールバーの DockedColumn、DockedRow、DockedPosition、FloatingLocation、および
// FloatingSize プロパティにアクセスします
switch (toolbar.DockedPosition)
{
case DockedPosition.Floating:
Rectangle rectFloating = new Rectangle(toolbar.FloatingLocation, toolbar.FloatingSize);
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is floating. Its position and size are: " + rectFloating.ToString());
break;
case DockedPosition.Top:
case DockedPosition.Bottom:
case DockedPosition.Left:
case DockedPosition.Right:
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is docked in position '" + toolbar.DockedPosition.ToString() + "'. Its DockedRow is: " + toolbar.DockedRow.ToString() + ", and its DockedColumn is: " + toolbar.DockedColumn.ToString());
break;
}
// ツールバーの Index プロパティにアクセスします
Debug.WriteLine("Toolbar '" + toolbar.Key + "' has an Index in its parent collection of: " + toolbar.Index.ToString());
// ツールバーの IsMainMenuBar プロパティにアクセスします
if (toolbar.IsMainMenuBar == true)
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is a main menu bar!");
else
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is NOT a main menu bar!");
// ツールバーの IsStockToolbar プロパティにアクセスします
if (toolbar.IsStockToolbar == true)
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is a stock toolbar!");
else
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is NOT a stock toolbar!");
// ツールバーの ParentCollection プロパティにアクセスします
if (toolbar.ParentCollection != null)
Debug.WriteLine("Toolbar '" + toolbar.Key + "' is in a collection that contains a total of " + toolbar.ParentCollection.Count.ToString() + " entries");
// ツールバーの ShowInToolbarList プロパティにアクセスします
if (toolbar.ShowInToolbarList == true)
Debug.WriteLine("Toolbar '" + toolbar.Key + "' will appear in the toolbar list");
else
Debug.WriteLine("Toolbar '" + toolbar.Key + "' will NOT appear in the toolbar list!");
Debug.IndentLevel--;
}
Debug.IndentLevel--;
}