ComboBox.OnSelectionChangeCommitted メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ComboBox.OnSelectionChangeCommitted メソッドの意味・解説 

ComboBox.OnSelectionChangeCommitted メソッド

SelectionChangeCommitted イベント発生させます

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Protected Overridable Sub
 OnSelectionChangeCommitted ( _
    e As EventArgs _
)
Dim e As EventArgs

Me.OnSelectionChangeCommitted(e)
protected virtual void OnSelectionChangeCommitted
 (
    EventArgs e
)
protected:
virtual void OnSelectionChangeCommitted (
    EventArgs^ e
)
protected void OnSelectionChangeCommitted (
    EventArgs e
)
protected function OnSelectionChangeCommitted
 (
    e : EventArgs
)

パラメータ

e

イベント データ格納している EventArgs。

解説解説
使用例使用例

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ComboBox.OnSelectionChangeCommitted メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ComboBox.OnSelectionChangeCommitted メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS