【发布时间】:2018-06-09 17:44:50
【问题描述】:
如何将 Windows 表单文本框中的值导出到现有的 excel 文件中? 单击“导出”按钮时,我希望将 4 个值(字符串)发送到现有的 excel 文件。导出按钮在另一个类中。
当单击导出按钮时,我希望将我或用户输入的以下 4 个值发送到现有 excel 文件的第二张表中(有 3 个)。理想情况下,我想选择将 4 个值发送到哪些单元格。
namespace XLSdataexport
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public string temp;
public string humidity;
public string pressure;
public string alfa;
private void textBox1_TextChanged_1(object sender, EventArgs e)
{
temp = textBox1.Text;
}
private void textBox2_textChanged_2(object sender, EventArgs e)
{
humid = textBox2.Text;
}
private void textBox3_textChanged_3(object sender, EventArgs e)
{
press = textBox3.Text;
}
private void textBox4_textChanged_4(object sender, EventArgs e)
{
alfa = textBox4.Text;
}
}
}
【问题讨论】:
-
你试过google this吗?您应该展示一些研究成果,而不是无意义的事件。
-
感谢 RH6。是的,另一个线程有答案。原谅我的小姐。至于你 TaW 2。你的回复并没有帮助。您不妨跳过评论。