C# Winform跨线程设置button的visibility

private bool IsShow = true;
        delegate void SetVisibilityCallback(bool show);

        private void SetVisibilityThreadSafe(bool show)
        {
            if (btnCancelUsage.InvokeRequired)
            {
                SetVisibilityCallback d = SetVisibilityThreadSafe;
                btnCancelUsage.Invoke(d, show);
            }
            else
            {
                btnCancelUsage.Visible = IsShow;
            }
        }
相关推荐
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页