c#中一个程序编写完成后如何修改命名空间?
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Da...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TextBox
{
private void btnstart_KeyPress(object sender, KeyPressEventArgs e)
{
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TextBox textBox = sender as TextBox; 此处出现错误。
错误 1 “TextBox”是“命名空间”,但此处被当做“类型”来使用
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if(e.KeyChar<'0' || e.KeyChar>'9')
{
e.Handled = true;
}
if (btnstart.SelectionStart==0 && e.KeyChar=='0')
{
e.Handled = true;
}
if (e.KeyChar== 8)
{
e.Handled = false;
}
}
private void l(object sender, EventArgs e)
{
}
}
} 展开
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TextBox
{
private void btnstart_KeyPress(object sender, KeyPressEventArgs e)
{
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TextBox textBox = sender as TextBox; 此处出现错误。
错误 1 “TextBox”是“命名空间”,但此处被当做“类型”来使用
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if(e.KeyChar<'0' || e.KeyChar>'9')
{
e.Handled = true;
}
if (btnstart.SelectionStart==0 && e.KeyChar=='0')
{
e.Handled = true;
}
if (e.KeyChar== 8)
{
e.Handled = false;
}
}
private void l(object sender, EventArgs e)
{
}
}
} 展开
1个回答
2013-08-01
展开全部
System.Windows.Forms.TextBox textBox = sender as System.Windows.Forms.TextBox;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询