UltimateZoneBuilder/Source/Interface/NumericTextbox.cs
2007-12-26 14:29:36 +00:00

71 lines
1.5 KiB
C#

#region ================== Copyright (c) 2007 Pascal vd Heiden
/*
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
* This program is released under GNU General Public License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#endregion
#region ================== Namespaces
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Globalization;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Controls;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.Editing;
#endregion
namespace CodeImp.DoomBuilder.Interface
{
internal class NumericTextbox : TextBox
{
#region ================== Constants
#endregion
#region ================== Variables
#endregion
#region ================== Properties
#endregion
#region ================== Constructor / Disposer
#endregion
#region ================== Methods
// When a key is pressed
protected override void OnKeyPress(KeyPressEventArgs e)
{
// Not numeric or control key?
if("-+0123456789\b".IndexOf(e.KeyChar) == -1)
{
// Cancel this
e.Handled = true;
}
// Call base
base.OnKeyPress(e);
}
#endregion
}
}