C# WinForm点击Radio判断是否选中,监控TextBox输入动作

阅读 106

2022-05-14

private void rdPersonalCRM_CheckedChanged(object sender, EventArgs e)
{
if (rdPersonalCRM.Checked)
{
txtConnStr.Text = @"Server=.\SQLEXPRESS;Initial Catalog=Dw_Personal;Trusted_Connection=true;MultipleActiveResultSets=true;";
}
}
private void txtSID_MouseMove(object sender,EventArgs e)
{
if (!txtSID.Text.Equals(""))
{
txtSourceText.Text = txtConnStr.Text+"&"+txtSID.Text.Trim();
}

}

注意要在_Load里添加对应的委托事件:

txtSID.MouseMove += new MouseEventHandler(txtSID_MouseMove);


学习交流群:364976091




精彩评论(0)

0 0 举报