用户
 找回密码
 立即注册

7

主题

16

帖子

405

积分

中级会员

Rank: 3Rank: 3

积分
405
发表于 2019-12-23 15:02:02

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=MTc2N3wwNzEzZTBmNDllM2M5NjQ1YTdiZjhhYjZkYzY3Y2FmM3wxNzEzNjA0NzQ1&request=yes&_f=.rarattach://1766.rar

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
分享至 : QQ空间
0 人收藏
使用道具 举报 回复
发表于 2019-12-24 11:16:04
这边测试使用你提供的handleUI()方法,并未发生loading,是否是你这边更新了更多的内容.
使用道具 举报 回复 支持 反对
发新帖
您需要登录后才可以回帖 登录 | 立即注册