Represents an up-down control that displays numeric values.
public class NumericUpDown: UpDownBase, ISupportInitialize
The following table lists the members exposed by the NumericUpDown object. Click a tab on the left to choose the type of member you want to view.
Methods
Method Description AdjustFormScrollbars Overriden. Adjusts the auto-scroll bars on the container based on the current control positions and the control currently selected. (Inherited from ContainerControl) BeginInit Begins the initialization of a NumericUpDown control. BringToFront Brings the control to the front of the z-order. (Inherited from Control) Contains Returns a value indicating whether the specified control is a child of the control. (Inherited from Control) CreateControl Forces the creation of the control, including the creation of the handle and any child controls. (Inherited from Control) CreateControlSkin Creates the skin for the Control. (Inherited from Control) CreateControlSkinInstance Overriden. Creates a ControlSkin instance for the UpDownBase object. (Inherited from UpDownBase) CreateControlsInstance Creates a new instance of the control collection for the control. (Inherited from Control) CreateHandle Creates a handle for the control. (Inherited from Control) DestroyHandle Destroys the handle associated with the control. (Inherited from Control) Dispose Overloaded. (Inherited from Component) DownButton Overriden. Decrements the value of the NumericUpDown control. EndInit Ends the initialization of a NumericUpDown control. Equals Overloaded. Compares two objects to determine if they are equal. (Inherited from Object) FindForm Returns the form that the control is on. (Inherited from Control) Focus Sets input focus to the control. (Inherited from Control) GetChildAtPoint Returns the child control that is located at the specified coordinates. (Inherited from Control) GetContainerControl Returns the next ContainerControl up the control's chain of parent controls. (Inherited from Control) GetHashCode Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object) GetNextControl Returns the next control forward or back in the tab order of child controls. (Inherited from Control) GetScrollState Determines whether the specified flag has been set. (Inherited from ScrollableControl) GetStyle Returns the value of the specified control style bit for the control. (Inherited from Control) GetTopLevel Determines if the control is a top-level control. (Inherited from Control) GetType Gets the Type of the current instance. (Inherited from Object) Hide Hides the control from the user. (Inherited from Control) InitLayout Initializes the layout state of the control after it has been added to another container. (Inherited from Control) InternalMethod Inherited from Control. Invalidate Overloaded. Invalidates the control. This will cause a paint event to be sent later to the control. (Inherited from Control) InvokeGotFocus Raises the GotFocus event for the specified control. (Inherited from Control) InvokeLostFocus Raises the LostFocus event for the specified control. (Inherited from Control) InvokeOnClick Raises the Click event for the specified control. (Inherited from Control) InvokePaint Raises the Paint event for the specified control. (Inherited from Control) InvokePaintBackground Invoke the Control.OnPaintBackground method for the specified control. (Inherited from Control) IsInputChar Determines if a character is an input character that the control recognizes. (Inherited from Control) IsInputKey Determines whether the specified key is a regular input key or a special key that requires preprocessing. (Inherited from Control) IsMnemonic Determines if the specified character is the mnemonic character assigned to the control in the specified string. (Inherited from Control) NumericUpDown Initializes a new instance of NumericUpDown. OnBackColorChanged Raises the BackColorChanged event. (Inherited from Control) OnCausesValidationChanged Raises the CausesValidationChanged event. (Inherited from Control) OnChanged When overridden in a derived class, raises the Changed event. (Inherited from UpDownBase) OnClick Raises the Click event. (Inherited from Control) OnClientSizeChanged Inherited from Control. OnControlAdded Raises the ControlAdded event. (Inherited from Control) OnControlRemoved Raises the ControlRemoved event. (Inherited from Control) OnCreateControl Overriden. Raises the CreateControl event. (Inherited from ScrollableControl) OnCursorChanged Raises the CursorChanged event. (Inherited from Control) OnDockChanged Raises the DockChanged event. (Inherited from Control) OnDoubleClick Raises the DoubleClick event. (Inherited from Control) OnEnabledChanged Raises the EnabledChanged event. (Inherited from Control) OnEnter Raises the Enter event. (Inherited from Control) OnFontChanged Overriden. Raises the FontChanged event. (Inherited from UpDownBase) OnForeColorChanged Raises the ForeColorChanged event. (Inherited from Control) OnGotFocus Raises the GotFocus event. (Inherited from Control) OnHandleCreated Overriden. Raises the HandleCreated event. (Inherited from UpDownBase) OnHandleDestroyed Raises the HandleDestroyed event. (Inherited from Control) OnKeyDown Raises the KeyDown event. (Inherited from Control) OnKeyPress Raises the KeyPress event. (Inherited from Control) OnKeyUp Raises the KeyUp event. (Inherited from Control) OnLayout Overriden. Raises the Layout event. (Inherited from UpDownBase) OnLeave Raises the Leave event. (Inherited from Control) OnLocationChanged Raises the LocationChanged event. (Inherited from Control) OnLostFocus Overriden. Raises the LostFocus event. OnMouseDown Overriden. Raises the MouseDown event. (Inherited from UpDownBase) OnMouseEnter Raises the MouseEnter event. (Inherited from Control) OnMouseLeave Raises the MouseLeave event. (Inherited from Control) OnMouseMove Raises the MouseMove event. (Inherited from Control) OnMouseUp Overriden. Raises the MouseUp event. (Inherited from UpDownBase) OnMouseWheel Overriden. Raises the MouseWheel event. (Inherited from UpDownBase) OnMove Raises the Move event. (Inherited from Control) OnNCPaint Occurs when the non-client area of the control needs to be redrawn. (Inherited from Control) OnPaint Overriden. Raises the Paint event. (Inherited from UpDownBase) OnPaintBackground Paints the background of the control. (Inherited from Control) OnParentChanged Raises the ParentChanged event. (Inherited from Control) OnParentEnabledChanged Raises the EnabledChanged event when the Enabled property value of the control's container changes. (Inherited from Control) OnParentVisibleChanged Raises the VisibleChanged event when the Visible property value of the control's container changes. (Inherited from Control) OnResize Raises the Resize event. (Inherited from Control) OnScroll Inherited from ScrollableControl. OnSizeChanged Raises the SizeChanged event. (Inherited from Control) OnSkinChanged Raises the SkinChanged event. (Inherited from Control) OnStyleChanged Raises the StyleChanged event. (Inherited from Control) OnTabIndexChanged Raises the TabIndexChanged event. (Inherited from Control) OnTabStopChanged Raises the TabStopChanged event. (Inherited from Control) OnTextBoxKeyDown Raises the KeyDown event. (Inherited from UpDownBase) OnTextBoxKeyPress Raises the KeyPress event. (Inherited from UpDownBase) OnTextBoxLostFocus Raises the LostFocus event. (Inherited from UpDownBase) OnTextBoxResize Raises the Resize event. (Inherited from UpDownBase) OnTextBoxTextChanged Raises the TextChanged event. (Inherited from UpDownBase) OnTextChanged Raises the TextChanged event. (Inherited from Control) OnValidated Raises the Validated event. (Inherited from Control) OnValidating Raises the Validating event. (Inherited from Control) OnValueChanged Raises the ValueChanged event. OnVisibleChanged Overriden. Raises the VisibleChanged event. (Inherited from ScrollableControl) ParseEditText Converts the text displayed in the NumericUpDown control to a numeric value. PerformLayout Overloaded. Forces the control to apply layout logic to all its child controls. (Inherited from Control) PointToClient Computes the location of the specified screen point into client coordinates. (Inherited from Control) PointToScreen Computes the location of the specified client point into screen coordinates. (Inherited from Control) ProcessDialogChar Overriden. Processes a dialog character. (Inherited from ContainerControl) ProcessDialogKey Overriden. Processes a dialog key. (Inherited from ContainerControl) ProcessMnemonic Overriden. Processes a mnemonic character. (Inherited from ContainerControl) ProcessTabKey Selects the next available control and makes it active. (Inherited from ContainerControl) RecreateHandle Forces the re-creation of the handle for the control. (Inherited from Control) RectangleToClient Computes the size and location of the specified screen rectangle in client coordinates. (Inherited from Control) RectangleToScreen Computes the size and location of the specified client rectangle in screen coordinates. (Inherited from Control) ReferenceEquals Determines whether the specified Object instances are the same instance. (Inherited from Object) Refresh Forces the control to invalidate its client area and immediately redraw itself and any child controls. (Inherited from Control) ResetBackColor Resets the BackColor property to its default value. (Inherited from Control) ResetCursor Resets the Cursor property to its default value. (Inherited from Control) ResetFont Resets the Font property to its default value. (Inherited from Control) ResetForeColor Resets the ForeColor property to its default value. (Inherited from Control) ResetSkin Resets the Skin property to its default value. (Inherited from Control) ResetText Resets the Text property to its default value. (Inherited from Control) ResumeLayout Overloaded. Resumes normal layout logic. (Inherited from Control) ScrollControlIntoView Scrolls the specified child control into view on a ScrollableControl object. (Inherited from ScrollableControl) Select Overloaded. Activates the control. (Inherited from Control) SelectNextControl Activates the next control. (Inherited from Control) SendToBack Sends the control to the back of the z-order. (Inherited from Control) SetAutoScrollMargin Sets the size of the auto-scroll margins of the ScrollableControl. (Inherited from ScrollableControl) SetBounds Overloaded. Sets the bounds of the control to the specified location and size. (Inherited from Control) SetBoundsCore Overriden. Performs the work of setting the specified bounds of this ScrollableControl. (Inherited from ScrollableControl) SetClientSizeCore Sets the size of the client area of the control. (Inherited from Control) SetDisplayRectLocation Sets the display location of the ScrollableControl. (Inherited from ScrollableControl) SetNCSizeCore Sets the non-client area of the control. (Inherited from Control) SetScrollState Sets the specified scroll state flag to the ScrollableControl. (Inherited from ScrollableControl) SetStyle Sets the specified style bit to the specified value. (Inherited from Control) SetTopLevel Sets the control as the top-level control. (Inherited from Control) SetVisibleCore Sets the control to the specified visible state. (Inherited from Control) Show Displays the control to the user. (Inherited from Control) SuspendLayout Temporarily suspends the layout logic for the control. (Inherited from Control) System.Windows.Forms.IContainerControl.ActivateControl Activates the specified control. (Inherited from ContainerControl) ToString Returns a String that represents the current Object. (Inherited from Object) UpButton Overriden. Increments the value of the NumericUpDown control. Update Causes the control to redraw its client area if it was invalidated. (Inherited from Control) UpdateBounds Overloaded. Updates the bounds of the control with the current size and location. (Inherited from Control) UpdateDefaultButton When overridden by a derived class, updates which button is the default button. (Inherited from ContainerControl) UpdateEditText Overriden. Displays the current value of the NumericUpDown control in the appropriate format. UpdateZOrder Updates the control in its parent's z-order. (Inherited from Control) Validate Validates the last invalidated control and its ancestors up through, but not including, the current control. (Inherited from ContainerControl) ValidateEditText Overriden. Validates the text displayed in the NumericUpDown control. Properties
Property Description ActiveControl Gets or sets the active control on the container control. (Inherited from ContainerControl) Anchor Gets or sets which edges of the control are anchored to the edges of its container. (Inherited from Control) AutoScroll Overriden. Gets or sets a value indicating whether the container will allow the user to scroll to any controls placed outside of its visible boundaries. (Inherited from UpDownBase) AutoScrollMargin Gets or sets the size of the auto-scroll margin. (Inherited from ScrollableControl) AutoScrollMinSize Gets or sets the minimum size of the auto-scroll. (Inherited from ScrollableControl) AutoScrollPosition Gets or sets the location of the auto-scroll position. (Inherited from ScrollableControl) BackColor Overriden. Gets or sets the background color of the UpDownBase control. (Inherited from UpDownBase) BackVisual Gets the visual of the control. (Inherited from Control) BorderStyle Gets or sets the border style for the UpDownBase control. (Inherited from UpDownBase) Bottom Gets the distance between the bottom edge of the control and the top edge of its container's client area. (Inherited from Control) Bounds Gets or sets the size and location of the control including its nonclient elements. (Inherited from Control) CanFocus Gets a value indicating whether the control can receive focus. (Inherited from Control) CanSelect Gets a value indicating whether the control can be selected. (Inherited from Control) Capture Gets or sets a value indicating whether the control has captured the mouse. (Inherited from Control) CausesValidation Gets or sets a value indicating whether the control causes validation for any controls that require validation when it receives focus. (Inherited from Control) ChangingText Gets or sets a value indicating whether the text property is being changed internally by its parent class. (Inherited from UpDownBase) ClientRectangle Gets the rectangle that represents the client area of the control. (Inherited from Control) ClientSize Gets or sets the height and width of the client area of the control. (Inherited from Control) Container Gets the IContainer that contains the Component. (Inherited from Component) ContainsFocus Gets a value indicating whether the control or one of its child controls currently has the input focus. (Inherited from Control) ControlSkin Gets the ControlSkin of the control. (Inherited from Control) Controls Gets the collection of controls contained within the control. (Inherited from Control) Created Gets a value indicating whether the control has been created. (Inherited from Control) Cursor Gets or sets the cursor which is displayed when the mouse pointer is over the control. (Inherited from Control) DecimalPlaces Gets or sets the number of decimal digits after the decimal symbol in a NumericUpDown control. DefaultBackColor Gets the default background color of the control. (Inherited from Control) DefaultFont Gets the default font of the control. (Inherited from Control) DefaultForeColor Gets the default foreground color of the control. (Inherited from Control) DefaultSize Overriden. Gets the default size of the UpDownBase control. (Inherited from UpDownBase) DefaultSkin Gets or sets the default skin of the control. (Inherited from Control) DisplayRectangle Overriden. Gets the rectangle which represents the display area of the ScrollableControl. (Inherited from ScrollableControl) Disposing Gets a value indicating whether the control is in the process of being disposed of. (Inherited from Control) Dock Gets or sets which edge of the parent container a control is docked to. (Inherited from Control) DockPadding Gets the dock padding settings for all edges of the ScrollableControl. (Inherited from ScrollableControl) Enabled Gets or sets a value indicating whether the control can react to user interaction. (Inherited from Control) Focused Overriden. Gets a value indicating whether the UpDownBase control has input focus. (Inherited from UpDownBase) Font Gets or sets the font of the text which is displayed by the control. (Inherited from Control) ForeColor Overriden. Gets or sets the foreground color of the UpDownBase control. (Inherited from UpDownBase) HScroll Gets or sets a value indicating whether the horizontal scroll bar of the ScrollableControl is visible. (Inherited from ScrollableControl) Handle Gets the native handle that the control is bound to. (Inherited from Control) HasChildren Gets a value indicating whether the control has one or more child controls. (Inherited from Control) Height Gets or sets the height of the control. (Inherited from Control) Hexadecimal Gets or sets a value indicating whether the NumericUpDown control should display the value it contains in hexadecimal format. Increment Gets or sets the value to increment or decrement the NumericUpDown control when the up or down buttons are clicked. InterceptArrowKeys Gets or sets a value indicating whether the user can use the UP ARROW and DOWN ARROW keys to select values. (Inherited from UpDownBase) IsDisposed Gets a value indicating whether the control has been disposed of. (Inherited from Control) IsHandleCreated Gets a value indicating whether the control has a handle associated with it. (Inherited from Control) Left Gets or sets the horizontal coordinate of a control's left edge. (Inherited from Control) Location Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container. (Inherited from Control) MaskVisual Gets the Visual which is the mask of the control. (Inherited from Control) Maximum Gets or sets the maximum allowed value for the NumericUpDown control. Minimum Gets or sets the minimum allowed value for the NumericUpDown control. ModifierKeys Gets a value indicating when one of the modifier keys (SHIFT, CTRL, and ALT) is pressed. (Inherited from Control) MouseButtons Gets a value indicating when one of the mouse buttons is clicked. (Inherited from Control) MousePosition Gets the position of the mouse cursor in global coordinates. (Inherited from Control) NCVisual Gets the non-client visual element of the control. (Inherited from Control) Name Gets or sets the name of the control. (Inherited from Control) OverlayVisual Gets a visual placed over everything. (Inherited from Control) Parent Gets or sets the parent container of the control. (Inherited from Control) ParentForm Gets the form that the container control is assigned to. (Inherited from ContainerControl) Parked Gets a value indicating whether the control is parked. (Inherited from Control) PreferredHeight Gets the preferred height of the UpDownBase control. (Inherited from UpDownBase) ReadOnly Gets or sets a value indicating whether the text can be changed by the use of the up or down buttons only. (Inherited from UpDownBase) RecreatingHandle Gets a value indicating whether the control is currently re-creating its handle. (Inherited from Control) Right Gets the distance between the right edge of the control and the left edge of its container. (Inherited from Control) Site Gets or sets the ISite of the Component. (Inherited from Component) Size Gets or sets the height and width of the control. (Inherited from Control) Skin Gets or sets the skin of the control. (Inherited from Control) SystemMenu Overriden. Gets or sets the SystemMenu of the control. (Inherited from UpDownBase) TabIndex Gets or sets the tab order of the control within its container. (Inherited from Control) TabStop Gets or sets a value indicating whether the user can use the TAB key to focus to the control. (Inherited from Control) Tag Gets or sets the object that contains data about the control. (Inherited from Control) Text Overriden. Gets or sets the text displayed in the UpDownBase control. (Inherited from UpDownBase) TextAlign Gets or sets the alignment of the text in the UpDownBase control. (Inherited from UpDownBase) ThousandsSeparator Gets or sets a value indicating whether a thousands separator should be displayed in the NumericUpDown control. Top Gets or sets the vertical coordinate of the control's top edge. (Inherited from Control) TopLevelControl Gets the parent control that is not parented by another Windows Forms control. (Inherited from Control) UserEdit Gets or sets a value indicating whether a value has been entered by the user. (Inherited from UpDownBase) VScroll Gets or sets a value indicating whether the vertical scroll bar of the ScrollableControl is visible. (Inherited from ScrollableControl) Value Gets or sets the value assigned to the NumericUpDown control. Visible Gets or sets a value indicating whether the control is visible. (Inherited from Control) Visual Gets the visual element of the control. (Inherited from Control) Width Gets or sets the width of the control. (Inherited from Control) Events
Event Description BackColorChanged Handles the changes of the BackColor property. (Inherited from Control) CausesValidationChanged Handles the changes of the CausesValidation property. (Inherited from Control) Click Handles the click event when the control is clicked. (Inherited from Control) ClientSizeChanged Inherited from Control. ControlAdded Handles the addition of a new control when it is added to the Control.ControlCollection. (Inherited from Control) ControlRemoved Handles the remove of a control from the Control.ControlCollection. (Inherited from Control) CursorChanged Handles the changes of the Cursor property. (Inherited from Control) Disposed Adds an event handler to listen to the Disposed event on the component. (Inherited from Component) DockChanged Handles the changes of the Dock property. (Inherited from Control) DoubleClick Handles the double-clicked event of the control. (Inherited from Control) EnabledChanged Handles the changes of the Enabled property. (Inherited from Control) Enter Handles the entered event of the control. (Inherited from Control) FontChanged Handles the changes of the Font property. (Inherited from Control) ForeColorChanged Handles the changes of the ForeColor property. (Inherited from Control) GotFocus Handles the focus reception of the control. (Inherited from Control) HandleCreated Handles the creation of a handle for the control. (Inherited from Control) HandleDestroyed Handles the control's handle which is in the process of being destroyed. (Inherited from Control) KeyDown Handles the pressed key event when a key is pressed and the control has focus. (Inherited from Control) KeyPress Handles the pressed key event when a key is pressed and the control has focus. (Inherited from Control) KeyUp Handles the release key event when a key is released and the control has focus. (Inherited from Control) Layout Handles the changes of control when it should reposition its child controls. (Inherited from Control) Leave Handles the input focus when it leaves the control. (Inherited from Control) LocationChanged Handles the changes of the Location property. (Inherited from Control) LostFocus Handles the focus on the control when it loses focus. (Inherited from Control) MouseDown Handles the mouse event when the mouse pointer is over the control and a mouse button is pressed. (Inherited from Control) MouseEnter Handles the mouse event when the mouse pointer enters the control. (Inherited from Control) MouseLeave Handles the mouse event when the mouse pointer leaves the control. (Inherited from Control) MouseMove Handles the mouse event when the mouse pointer is moved over the control. (Inherited from Control) MouseUp Handles the mouse event when the mouse pointer is over the control and a mouse button is released. (Inherited from Control) MouseWheel Handles the mouse event when the mouse wheel moves while the control has focus. (Inherited from Control) Move Handles the motion of the control when it is moved. (Inherited from Control) Paint Handles the paint event of the control when it is redrawn. (Inherited from Control) ParentChanged Handles the changes of the Parent property. (Inherited from Control) Resize Handles the size changes of the control when it is resized. (Inherited from Control) Scroll Inherited from ScrollableControl. SizeChanged Handles the changes of the Size property. (Inherited from Control) SkinChanged Handles the changes of the Skin property. (Inherited from Control) StyleChanged Handles the changes of the control style. (Inherited from Control) TabIndexChanged Handles the changes of the TabIndex property. (Inherited from Control) TabStopChanged Handles the changes of the TabStop property. (Inherited from Control) TextChanged Handles the changes of the Text property. (Inherited from Control) Validated Handles the validation of the control when it is finished validating. (Inherited from Control) Validating Handles the validation of the control when it is validating. (Inherited from Control) ValueChanged Handles the changes of the Value property. VisibleChanged Determines the value of the VScroll property. (Inherited from Control) Constants
Constant Description ScrollState_AutoScrolling Determines the value of the AutoScroll property. (Inherited from ScrollableControl) ScrollState_HScrollVisible Determines the value of the HScroll property. (Inherited from ScrollableControl) ScrollState_UserHasScrolled Determines whether the user has scrolled the ScrollableControl. (Inherited from ScrollableControl) ScrollState_VScrollVisible Determines the value of the VScroll property. (Inherited from ScrollableControl)
Object
// This sample shows how to create and use a NumericUpDown object.
using System;
using System.Drawing;
using System.Windows.Forms;
public class MyForm : System.Windows.Forms.Form
{
private System.Windows.Forms.NumericUpDown numeric1;
private System.Windows.Forms.Label label1;
public MyForm()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.numeric1
= new System.Windows.Forms.NumericUpDown();this.numeric1.Location= new System.Drawing.Point(10, 10);
this.numeric1.DecimalPlaces= 2;
this.numeric1.ValueChanged += new EventHandler( on_value_changed );
this.Controls.Add( this.numeric1 );
this.label1= new System.Windows.Forms.Label();
this.label1.Location= new System.Drawing.Point(5, numeric1.Bottom+5);
this.label1.Size= new Size( Application.Width-2*label1.Left, Application.Height-numeric1.Bottom-10 );
this.Controls.Add( this.label1 );
}
private void on_value_changed( object sender, EventArgs e )
{
this.label1.Text= "'" + this.numeric1.Value.ToString() + "' has been selected";
}
static void Main()
{
Application.Run( new MyForm() );
}
}
Namespace System.Windows.Forms Flash Library System.Windows.Forms.scl Flash Library Version 2.0.0.2118 Silverlight Library System.Windows.Forms.dll
| © 2003-2007 NETiKA Technologies. All rights reserved. |