From 04fdeb9a70ee7ba0e0e3cef120945181245ba88d Mon Sep 17 00:00:00 2001 From: Troy Date: Tue, 16 Jun 2015 15:32:11 +0800 Subject: [PATCH] =?UTF-8?q?Edit=E8=AE=BE=E7=BD=AE=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Edit支持动态设置密码属性 --- .gitignore | 5 +++++ DuiLib/Control/UIEdit.cpp | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..7558e1fa --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.ilk +*.pdb +*.map +*.bsc +*.sdf \ No newline at end of file diff --git a/DuiLib/Control/UIEdit.cpp b/DuiLib/Control/UIEdit.cpp index a121f023..400e45ed 100644 --- a/DuiLib/Control/UIEdit.cpp +++ b/DuiLib/Control/UIEdit.cpp @@ -373,6 +373,12 @@ namespace DuiLib if( m_bPasswordMode == bPasswordMode ) return; m_bPasswordMode = bPasswordMode; Invalidate(); + if( m_pWindow != NULL ) + { + LONG styleValue = ::GetWindowLong(*m_pWindow, GWL_STYLE); + bPasswordMode ? styleValue |= ES_PASSWORD : styleValue &= ~ES_PASSWORD; + ::SetWindowLong(*m_pWindow, GWL_STYLE, styleValue); + } } bool CEditUI::IsPasswordMode() const