'宣言 Public ReadOnly Property UIElement As GroupUIElement
public GroupUIElement UIElement {get;}
Imports System.Diagnostics Imports Infragistics.Win Imports Infragistics.Win.UltraWinExplorerBar Private Sub Button31_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button31.Click ' For each group, display the size, and location of its UIElement. ' Also display the number of child elements in the group's UIElement. Dim group As UltraExplorerBarGroup For Each group In Me.ultraExplorerBar1.Groups If (Not group.UIElement Is Nothing) Then Dim messageText As String = "The size of the UIElement for Group '{0}' is {1} and its location is {2}. It contains {3} element(s)" Dim messageTextFormatted As String = String.Format(messageText, _ group.Text, _ group.UIElement.Rect.Size.ToString(), _ group.UIElement.Rect.Location.ToString(), _ group.UIElement.ChildElements.Count) Debug.WriteLine(messageTextFormatted) End If Next End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinExplorerBar; private void button31_Click(object sender, System.EventArgs e) { // For each group, display the size, and location of its UIElement. // Also display the number of child elements in the group's UIElement. foreach(UltraExplorerBarGroup group in this.ultraExplorerBar1.Groups) { if (group.UIElement != null) { string messageText = "The size of the UIElement for Group '{0}' is {1} and its location is {2}. It contains {3} element(s)"; string messageTextFormatted = string.Format(messageText, group.Text, group.UIElement.Rect.Size.ToString(), group.UIElement.Rect.Location.ToString(), group.UIElement.ChildElements.Count); Debug.WriteLine(messageTextFormatted); } } }