private void btnN1_Click(object sender, EventArgs e)
{
this.txt.Text += btnN1.Text;
}给每个数字按钮写上类似的代码
{
this.txt.Text += btnN1.Text;
}给每个数字按钮写上类似的代码
解决方案 »
- 是否缺少using指令或程序集引用
- 问一个关于枚举的问题
- C#一个选择语句
- 为什么2个combox的selectindexchange事件会相互触发?
- 关于局部变量问题
- 查了很多资料竟然都没有,Winform中,如何在TreeView中点击右键,选中当前节点,并且弹出一个菜单!
- NET如何精确计算一个对象占用的内存空间(GMK)
- 正则表达式,字符串匹配?
- 留住ArLi2003 (阿利 路过.NET) ,同意请跟贴!
- 给个思路,如何禁止鼠标在整个系统中的点击?(不仅仅是本身这个程序)
- 使用Microsoft.Office.Interop.Excel.dll出现问题
- 一个c#连接sql mobile的问题,巨急。请各位帮忙看一下
private void ShowNum(object sender, EventArgs e)
{
textBox1.Text = ((Button)sender).Text;
}
designer.cs里修改
(X为0-9)
this.buttonX.Click += new System.EventHandler(this.ShowNum);
TextBox _TextBox = null;
public TextBox TextBox
{
get { return _TextBox; }
set
{
if (_TextBox != value)
{
_TextBox = value;
}
}
} private void btnOne_Click(object sender, EventArgs e)
{
if (this.TextBox != null)
{
this.TextBox.Text += btnOne.Text;
this.TextBox.Focus();
this.TextBox.SelectionStart=this.TextBox.Text.Length;
}
} private void txtBox(object sender, EventArgs e)
{
textBox.Text = ((txtBox)sender).Text;
}
{
textBox.Text = ((txtBox)sender).Text;
}少打了必个字