|
TextBox的TouchLeave事件中更新赋值了Label的Text属性。
打包版的APP中会出现”请稍候“提示框,影响体验。开发版的APP不会出现。
附件中我上传了2个版本的操作视频。
TextBox的TouchLeave事件代码如下:
private void txtAmount_TouchLeave(object sender, EventArgs e)
{
string Amount = txtAmount.Text;
if (Amount != oldAmount)
{
if (Amount == "" || Amount == "0" || Amount == "0.0")
{
txtAmount.Text = oldAmount;
}
else
{
handleUI();
}
}
}
private void handleUI()
{
string WholePackRate = txtWholePackRate.Text;
string WholeAmount = txtWholeAmount.Text;
string Amount = txtAmount.Text;
if (string.IsNullOrEmpty(WholePackRate) || string.IsNullOrEmpty(Amount))
return;
double dWholePackRate = 0, dAmount = 0;
bool bFlag = double.TryParse(WholePackRate, out dWholePackRate);
if (!bFlag) return;
bFlag = double.TryParse(Amount, out dAmount);
if (!bFlag) return;
string s = Math.Ceiling(dAmount / dWholePackRate).ToString();
txtWholeAmount.Text = s;
if (lblTaskState.Text == "未执行")
{
lblTaskState.ForeColor = System.Drawing.Color.Red;
}
}
https://www.smobiler.com/forum.php?mod=attachment&aid=MTc2N3wxODZjZWJmZDVjNmRjOWUzZWY2MTljMDEzNTQyMTRjM3wxNzQ2MTIxNzEw&request=yes&_f=.rarattach://1766.rar
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|