tijian_jichuang/Code/SOH.Kernel/Window/baseForm.cs

60 lines
2.0 KiB
C#
Raw Permalink Normal View History

2025-02-20 11:54:48 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
namespace SOH.Window
{
public class baseForm : DockContent
{
private void InitializeComponent()
{
this.SuspendLayout();
//
// baseForm
//
this.ClientSize = new System.Drawing.Size(284, 262);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)((((((WeifenLuo.WinFormsUI.Docking.DockAreas.Float | WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "baseForm";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Unknown;
this.Load += new System.EventHandler(this.baseForm_Load);
this.ResumeLayout(false);
}
private void baseForm_Load(object sender, EventArgs e)
{
}
private bool m_nonNumberEntered = false;
public void m_textBox_KeyDown(object sender, KeyEventArgs e)
{
m_nonNumberEntered = false;
if (e.KeyCode < Keys.D0 || e.KeyCode > Keys.D9)
{
if (e.KeyCode < Keys.NumPad0 || e.KeyCode > Keys.NumPad9)
{
if (e.KeyCode != Keys.Back)
{
m_nonNumberEntered = true;
}
}
}
}
public void m_textBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (m_nonNumberEntered)
{
e.Handled = true;
}
}
}
}