Numeric value based Up Down (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 
Numeric value based Up Down (Spinner)
Numeric value based Up Down (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.NumericUpDown numericUpDown;

    public UpDownForm()
    {
      InitializeComponent();
    }
    private void InitializeComponent()
    {
      this.label1 = new System.Windows.Forms.Label ();
      this.numericUpDown = new System.Windows.Forms.NumericUpDown ();
      this.btnGetSelections = new System.Windows.Forms.Button ();
      this.lblCurrSel = new System.Windows.Forms.Label ();
      numericUpDown.BeginInit ();

      label1.Location = new System.Drawing.Point (880);
      label1.Text = "Numeric UpDown Control";
      label1.Size = new System.Drawing.Size (23232);
      label1.Font = new System.Drawing.Font ("Verdana"12);
      label1.TabIndex = 3;
      numericUpDown.Location = new System.Drawing.Point (26480);
      numericUpDown.Maximum = new decimal (5000);
      numericUpDown.Size = new System.Drawing.Size (16820);
      numericUpDown.ThousandsSeparator = true;
      numericUpDown.TabIndex = 1;
      numericUpDown.UpDownAlign = System.Windows.Forms.LeftRightAlignment.Left;
      numericUpDown.ValueChanged += new System.EventHandler (this.numericUpDown_ValueChanged);

      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.numericUpDown);
      numericUpDown.EndInit ();
    }
    static void Main() 
    {
      Application.Run(new UpDownForm());
    }

    protected void numericUpDown_ValueChanged (object sender, System.EventArgs e)
    {
      this.Text = "You changed the numeric value...";
    }

    protected void btnGetSelections_Click (object sender, System.EventArgs e)
    {
      lblCurrSel.Text =  "Number: " 
        + numericUpDown.Value;
    }
  }

           
       
Related examples in the same category
1.Convert value from Numeric Dropdown to IntConvert value from Numeric Dropdown to Int
2.String based DomainUpDown (Spinner)String based DomainUpDown (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.