SetDefaultFont() public static method

public static SetDefaultFont ( Control c ) : void
c System.Windows.Forms.Control
return void
コード例 #1
0
        public void EnableProtection(bool bEnable)
        {
            if (m_tbPassword == null)
            {
                Debug.Assert(false); return;
            }

            if (!MonoWorkarounds.IsRequired(5795))
            {
                if (bEnable)
                {
                    FontUtil.AssignDefault(m_tbPassword);
                }
                else
                {
                    FontUtil.SetDefaultFont(m_tbPassword);
                    FontUtil.AssignDefaultMono(m_tbPassword, true);
                }
            }

            if (m_tbPassword.UseSystemPasswordChar == bEnable)
            {
                return;
            }
            m_tbPassword.UseSystemPasswordChar = bEnable;

            ShowCurrentPassword(-1, -1);
        }
コード例 #2
0
        public void EnableProtection(bool bEnable)
        {
            if (m_tbPassword == null)
            {
                Debug.Assert(false); return;
            }

            if (bEnable)
            {
                FontUtil.AssignDefault(m_tbPassword);
            }
            else
            {
                FontUtil.SetDefaultFont(m_tbPassword);
                FontUtil.AssignDefaultMono(m_tbPassword, true);
            }

            if (m_tbPassword.UseSystemPasswordChar == bEnable)
            {
                return;
            }
            m_tbPassword.UseSystemPasswordChar = bEnable;

            ShowCurrentPassword(m_tbPassword.SelectionStart, m_tbPassword.SelectionLength);
        }
コード例 #3
0
ファイル: SecureTextBoxEx.cs プロジェクト: eberzosa/KeePass
        public virtual void EnableProtection(bool bEnable)
        {
            if (bEnable == this.UseSystemPasswordChar)
            {
                return;
            }

            if (!MonoWorkarounds.IsRequired(5795))
            {
                FontUtil.SetDefaultFont(this);

                if (bEnable)
                {
                    FontUtil.AssignDefault(this);
                }
                else
                {
                    FontUtil.AssignDefaultMono(this, true);
                }
            }

            this.UseSystemPasswordChar = bEnable;
            ShowCurrentText(-1, -1);
        }