C#winFrom中怎么把一个窗体文本框赋值给多个不同窗体,怎么判断窗体?
1条回答 默认 最新
threenewbee 2018-11-26 10:41关注如果问题得到解决,请点我回答左上角的采纳和向上的箭头,谢谢
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 Q714723 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { new Form2().Show(); new Form3().Show(); new Form4().Show(); } private void button2_Click(object sender, EventArgs e) { foreach (Form item in Application.OpenForms) { if (item != this) (item.Controls["textBox1"] as TextBox).Text = textBox1.Text; } } } }评论 打赏 举报解决 1无用
