リスト部分がすでに表示されている場合、DropDown メソッドは、何もしないで True を返します。
DropDown メソッドが呼び出されると、BeforeDropDown イベントが発生します。イベントがキャンセルされると、リスト部分は表示されず、AfterDropDown イベントは発生しません。この場合、DropDown メソッドは False を返します。
Imports Infragistics.Win Imports Infragistics.Win.UltraWinEditors Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' Clear the existing list Me.UltraComboEditor1.Items.Clear() ' Add 5 new items to the list Me.UltraComboEditor1.Items.Add(1, "One") Me.UltraComboEditor1.Items.Add(2, "Two") Me.UltraComboEditor1.Items.Add(3, "Three") Me.UltraComboEditor1.Items.Add(4, "Four") Me.UltraComboEditor1.Items.Add(5, "Five") ' Make the first item in the list the SelectedItem Me.UltraComboEditor1.SelectedIndex = 0 ' Use the DropDown method to programmatically make ' the list portion appear Me.UltraComboEditor1.DropDown() End Sub Private Sub UltraComboEditor1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles UltraComboEditor1.SelectionChanged ' If the last item in the list was selected, use the CloseUp method ' to programmatically hide the list portion If (Me.UltraComboEditor1.SelectedIndex = (Me.UltraComboEditor1.Items.Count - 1)) Then Me.UltraComboEditor1.CloseUp() End If End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinEditors; private void button1_Click(object sender, System.EventArgs e) { // Clear the existing list this.ultraComboEditor1.Items.Clear(); // Add 5 new items to the list this.ultraComboEditor1.Items.Add( 1, "One" ); this.ultraComboEditor1.Items.Add( 2, "Two" ); this.ultraComboEditor1.Items.Add( 3, "Three" ); this.ultraComboEditor1.Items.Add( 4, "Four" ); this.ultraComboEditor1.Items.Add( 5, "Five" ); // Make the first item in the list the SelectedItem this.ultraComboEditor1.SelectedIndex = 0; // Use the DropDown method to programmatically make // the list portion appear this.ultraComboEditor1.DropDown(); } private void ultraComboEditor1_SelectionChanged(object sender, System.EventArgs e) { // If the last item in the list was selected, use the CloseUp method // to programmatically hide the list portion if ( this.ultraComboEditor1.SelectedIndex == (this.ultraComboEditor1.Items.Count - 1) ) { this.ultraComboEditor1.CloseUp(); } }