2
我正在建立一个赢得应用程序,并在那,我有一个文本框被充满动态,并且我有一个复选框,当我的应用程序中的所有消息框checkBox.Checked=true
将弹出
(并非所有的一次,只是确认味精的我无论我编码它,一个接一个)。Textbox.text没有得到填充,C#
我的问题是,当checkBox
被选中,我TextBox.Text
是越来越充满了数据,但是当checkBox
未被选中,TextBox.text
是没有得到填充数据,奇怪的事情是,当我试图调试它,TextBox.Text
是显示文本,但关于gui TextBox.Text
没有填写,现在哪里有数据?
public void Recharge()
{
txtTransactionMsgDelegate(Tm) // this is delegate function which fills the text
//textbox.text=tm; i tried this one too,but no use
}
if (Program.AutoManual == "Auto")
{
if (chkShowMsg.Checked)
{
if (returnRows < 1)
MessageBox.Show(Program.StatusMessage + " But Local Db Failed, NOTEDOWN IN NOTEBOOK");
else
MessageBox.Show(Program.StatusMessage + " And Local Db update SuccessFul, RUN UPDATE RECHARGE LATER");
}
}
委托功能:
// m using this delegate b'coz my above function i.e Recharge() is under BackGroundWorker Thread i.e BackGroundWorker_DoWork() event;
private void txtTransactionMsgDelegate(string Text)
{
if (txtTransactionMsg.InvokeRequired)
{
txtTransactionMsg.Invoke(new Action(delegate() { txtTransactionMsgDelegate(Text); }));
}
else
txtTransactionMsg.Text = Text;
}
感谢名单猪头...它的工作原理 – FosterZ 2010-10-26 09:55:21