2个回答
展开全部
/// <summary>
/// 窗体加载时开始
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Form1_Load(object sender, EventArgs e)
{
Timer timer_refresh = new Timer();
timer_refresh.Interval = 5000;//时间间隔5秒,取得每个textbox的文本
timer_refresh.Tick += new EventHandler(timer1_Tick);
timer_refresh.Enabled = true;
}
/// <summary>
/// timer事件循环拿取文本
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
private void timer1_Tick(object sender, EventArgs args)
{
foreach (Control c in this.Controls)
{
if (c is TextBox)
{
string s = (c as TextBox).Text;
}
}
}
/// 窗体加载时开始
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Form1_Load(object sender, EventArgs e)
{
Timer timer_refresh = new Timer();
timer_refresh.Interval = 5000;//时间间隔5秒,取得每个textbox的文本
timer_refresh.Tick += new EventHandler(timer1_Tick);
timer_refresh.Enabled = true;
}
/// <summary>
/// timer事件循环拿取文本
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
private void timer1_Tick(object sender, EventArgs args)
{
foreach (Control c in this.Controls)
{
if (c is TextBox)
{
string s = (c as TextBox).Text;
}
}
}
追问
很感谢了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询