![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
2个回答
展开全部
这个的话你看直接这样!比如你的标签的是label 它的ID是label1,你的文本框是textbox 它的ID是textbox1,你点击按钮事件把label的值给textbox
你只要这样就可以啦!textbox1.text=label1.text.Substring(0,3);就可以啦!
你只要这样就可以啦!textbox1.text=label1.text.Substring(0,3);就可以啦!
展开全部
标签label,文本框text,按钮Button,
代码如下:
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 CASEnew_04
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
label1.Text = "1234"; //你想要的标签文字,随便写,或者直接在label属性中的Text改
textBox1.Text = label1.Text.Substring(0, 3);
}
}
}
代码如下:
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 CASEnew_04
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
label1.Text = "1234"; //你想要的标签文字,随便写,或者直接在label属性中的Text改
textBox1.Text = label1.Text.Substring(0, 3);
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询