External/Aga.Controls/Tree/NodeControls/NodeIntegerTextBox.cs
author moel.mich
Sun, 27 May 2012 15:16:19 +0000
changeset 345 0c551e8818e0
permissions -rw-r--r--
Added the source code of Aga.Controls (TreeViewAdv for .Net) version 1.7.0.0.
     1 using System;
     2 using System.Collections.Generic;
     3 using System.Text;
     4 using System.ComponentModel;
     5 using System.Windows.Forms;
     6 
     7 namespace Aga.Controls.Tree.NodeControls
     8 {
     9 
    10 	public class NodeIntegerTextBox : NodeTextBox
    11 	{
    12 		private bool _allowNegativeSign = true;
    13 		[DefaultValue(true)]
    14 		public bool AllowNegativeSign
    15 		{
    16 			get { return _allowNegativeSign; }
    17 			set { _allowNegativeSign = value; }
    18 		}
    19 
    20 		public NodeIntegerTextBox()
    21 		{
    22 		}
    23 
    24 		protected override TextBox CreateTextBox()
    25 		{
    26 			NumericTextBox textBox = new NumericTextBox();
    27 			textBox.AllowDecimalSeparator = false;
    28 			textBox.AllowNegativeSign = AllowNegativeSign;
    29 			return textBox;
    30 		}
    31 
    32 		protected override void DoApplyChanges(TreeNodeAdv node, Control editor)
    33 		{
    34 			SetValue(node, (editor as NumericTextBox).IntValue);
    35 		}
    36 	}
    37 }