c# - 如何在按钮后面传递文本并将其传递给文本框?像“预览”
问题描述
按钮内有一个小文本:
private void TASKTOVSWRBTN_Click(object sender, EventArgs e) { Clipboard.SetText("The Network Operations Center is requesting a field engineer to attend the site in order to solve this issue. " + "\n Check carefully the hardware, cabling or passive network equipments, so the issue can be easily identified." + "\n If support is needed, please ring us, we will be here 24 / 7 to help.");
我想预览文本框内按钮后面的文本
将文本复制到剪贴板。
目前我只能从按钮复制到剪贴板。但我想在将其发送到剪贴板之前查看文本,例如预览。
解决方案
那只是:
private void TASKTOVSWRBTN_Click(object sender, EventArgs e)
{
// "preview" the message in the textbox:
bunifuMetroTextbox1.Text = "The Network Operations Center is requesting a field engineer to attend the site in order to solve this issue. " +
"\n Check carefully the hardware, cabling or passive network equipments, so the issue can be easily identified." +
"\n If support is needed, please ring us, we will be here 24 / 7 to help.";
}
private void btnGetIt_Click(object sender, EventArgs e)
{
// if the textbox is not empty, then place its contents on the clipboard
if (bunifuMetroTextbox1.Text.Trim().Length > 0)
{
Clipboard.SetText(bunifuMetroTextbox1.Text.Trim());
}
}
推荐阅读
- python - 为 python2 安装期货
- javascript - Vue Js Toggle Tree Like Cascading Dropdown
- python - 将训练标签传递给 tf.keras.preprocessing.image_dataset_from_directory 不起作用
- python - 第一次制作波表合成器......有人能指出我正确的方向吗?
- html - 如何使用 Angular 设置背景图像?
- python - 如何使用熊猫循环:'对于文件中的每一行,对于行中的每一列'
- vb.net - 使用 vb.net 中的组合框更改设置
- c++ - 在 C++ 非类型模板参数中使用 decltype(auto)
- javascript - 简明检查变量是否是对象但不是数组或日期
- python - 生成 django admin 和外键错误