本文整理匯總了C#中System.Windows.Forms.DomainUpDown.SelectedItemChanged事件的典型用法代碼示例。如果您正苦於以下問題:C# DomainUpDown.SelectedItemChanged事件的具體用法?C# DomainUpDown.SelectedItemChanged怎麽用?C# DomainUpDown.SelectedItemChanged使用的例子?那麽, 這裏精選的事件代碼示例或許可以為您提供幫助。您也可以進一步了解該事件所在類System.Windows.Forms.DomainUpDown
的用法示例。
在下文中一共展示了DomainUpDown.SelectedItemChanged事件的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DomainUpDown1_SelectedItemChanged
private void DomainUpDown1_SelectedItemChanged(Object sender, EventArgs e) {
MessageBox.Show("You are in the DomainUpDown.SelectedItemChanged event.");
}
示例2: UpDownForm
//引入命名空間
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
public class UpDownForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Label lblCurrSel;
private System.Windows.Forms.Button btnGetSelections;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.DomainUpDown domainUpDown;
public UpDownForm()
{
this.label1 = new System.Windows.Forms.Label ();
this.domainUpDown = new System.Windows.Forms.DomainUpDown ();
this.btnGetSelections = new System.Windows.Forms.Button ();
this.lblCurrSel = new System.Windows.Forms.Label ();
label1.Location = new System.Drawing.Point (8, 24);
label1.Text = "Domain UpDown Control";
label1.Size = new System.Drawing.Size (224, 32);
label1.Font = new System.Drawing.Font ("Verdana", 12);
domainUpDown.Location = new System.Drawing.Point (264, 24);
domainUpDown.Text = "domainUpDown1";
domainUpDown.Size = new System.Drawing.Size (168, 20);
domainUpDown.TabIndex = 0;
domainUpDown.Sorted = true;
domainUpDown.Wrap = true;
domainUpDown.SelectedItemChanged += new System.EventHandler (this.domainUpDown_SelectedItemChanged);
domainUpDown.Items.AddRange(new object[4] {"B", "A", "C", "(D)"});
btnGetSelections.Location = new System.Drawing.Point (16, 136);
btnGetSelections.Size = new System.Drawing.Size (136, 24);
btnGetSelections.TabIndex = 4;
btnGetSelections.Text = "Get Current Selections";
btnGetSelections.Click += new System.EventHandler (this.btnGetSelections_Click);
lblCurrSel.Location = new System.Drawing.Point (176, 120);
lblCurrSel.Size = new System.Drawing.Size (256, 48);
this.Text = "Spin Controls";
this.AutoScaleBaseSize = new System.Drawing.Size (5, 13);
this.ClientSize = new System.Drawing.Size (448, 181);
this.Controls.Add (this.lblCurrSel);
this.Controls.Add (this.btnGetSelections);
this.Controls.Add (this.label1);
this.Controls.Add (this.domainUpDown);
}
static void Main()
{
Application.Run(new UpDownForm());
}
protected void domainUpDown_SelectedItemChanged (object sender, System.EventArgs e)
{
this.Text = "You changed the string value...";
}
protected void btnGetSelections_Click (object sender, System.EventArgs e)
{
// Get info from updowns...
lblCurrSel.Text = "String: "
+ domainUpDown.Text ;
}
}