String based DomainUpDown (Spinner) : UpDown « GUI Windows Form « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » GUI Windows Form » UpDownScreenshots 
String based DomainUpDown (Spinner)
String based DomainUpDown (Spinner)


  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()
    {
      InitializeComponent();
    }

    private void InitializeComponent()
    {
      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 (824);
      label1.Text = "Domain UpDown Control";
      label1.Size = new System.Drawing.Size (22432);
      label1.Font = new System.Drawing.Font ("Verdana"12);
      label1.TabIndex = 2;

      domainUpDown.Location = new System.Drawing.Point (26424);
      domainUpDown.Text = "domainUpDown1";
      domainUpDown.Size = new System.Drawing.Size (16820);
      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 (16136);
      btnGetSelections.Size = new System.Drawing.Size (13624);
      btnGetSelections.TabIndex = 4;
      btnGetSelections.Text = "Get Current Selections";
      btnGetSelections.Click += new System.EventHandler (this.btnGetSelections_Click);

      lblCurrSel.Location = new System.Drawing.Point (176120);
      lblCurrSel.Size = new System.Drawing.Size (25648);
      this.Text = "Spin Controls";
      this.AutoScaleBaseSize = new System.Drawing.Size (513);
      this.ClientSize = new System.Drawing.Size (448181);
      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 ;
    }
  }

           
       
Related examples in the same category
1.Convert value from Numeric Dropdown to IntConvert value from Numeric Dropdown to Int
2.Numeric value based Up Down (Spinner)Numeric value based Up Down (Spinner)
3.UpDown ControlUpDown Control
4.UpDown DerivedUpDown Derived
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.