ComboBox.SelectionChangeCommitted イベント
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Public Event SelectionChangeCommitted As EventHandler
Dim instance As ComboBox Dim handler As EventHandler AddHandler instance.SelectionChangeCommitted, handler
public event EventHandler SelectionChangeCommitted
public: event EventHandler^ SelectionChangeCommitted { void add (EventHandler^ value); void remove (EventHandler^ value); }
/** @event */ public void add_SelectionChangeCommitted (EventHandler value) /** @event */ public void remove_SelectionChangeCommitted (EventHandler value)

SelectionChangeCommitted は、ユーザーがコンボ ボックスの選択項目を変更したときにのみ発生します。SelectedIndexChanged イベントと SelectedValueChanged イベントは、プログラム上で選択項目が変更されたときにも発生するため、ユーザーによる変更をキャプチャする目的でこれらのイベントを使用しないでください。
ユーザーがリスト内の選択した項目を変更するときに、SelectionChangeCommitted イベント ハンドラを作成して ComboBox に対して特別な処理を実行できます。

SelectionChangeCommitted イベントと SelectionLength プロパティを使用して、ユーザーが選択してコミットした項目に応じてテキスト ボックスの長さを変更するコード例を次に示します。
Private Sub comboBox1_SelectionChangeCommitted(ByVal sender _ As Object, ByVal e As EventArgs) _ Handles comboBox1.SelectionChangeCommitted Dim senderComboBox As ComboBox = CType(sender, ComboBox) ' Change the length of the text box depending on what the user has ' selected and committed using the SelectionLength property. If (senderComboBox.SelectionLength > 0) Then textbox1.Width = senderComboBox.SelectionLength * _ CType(Me.textbox1.Font.SizeInPoints, Integer) textbox1.Text = senderComboBox.SelectedText End If End Sub
private void comboBox1_SelectionChangeCommitted(object sender, EventArgs e) { ComboBox senderComboBox = (ComboBox) sender; // Change the length of the text box depending on what the user has // selected and committed using the SelectionLength property. if (senderComboBox.SelectionLength > 0) { textbox1.Width = senderComboBox.SelectionLength * ((int) this.textbox1.Font.SizeInPoints); textbox1.Text = senderComboBox.SelectedText; } }
void comboBox1_SelectionChangeCommitted( Object^ sender, EventArgs^ /*e*/ ) { ComboBox^ senderComboBox = dynamic_cast<ComboBox^>(sender); // Change the length of the text box depending on what the user has // selected and committed using the SelectionLength property. if ( senderComboBox->SelectionLength > 0 ) { textbox1->Width = senderComboBox->SelectionLength * ((int)this->textbox1->Font->SizeInPoints); textbox1->Text = senderComboBox->SelectedText; } }
private void comboBox1_SelectionChangeCommitted(Object sender, EventArgs e) { ComboBox senderComboBox = (ComboBox)sender; // Change the length of the text box depending on what the user has // selected and committed using the SelectionLength property. if (senderComboBox.get_SelectionLength() > 0) { textBox1.set_Width(senderComboBox.get_SelectionLength() * (int)( this.textBox1.get_Font().get_SizeInPoints())); textBox1.set_Text(senderComboBox.get_SelectedText()); } } //comboBox1_SelectionChangeCommitted

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からComboBox.SelectionChangeCommitted イベントを検索する場合は、下記のリンクをクリックしてください。

- ComboBox.SelectionChangeCommitted イベントのページへのリンク