Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Password Fields
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Password Fields

 Post Reply Post Reply
Author
Message
JDonovan View Drop Down
Newbie
Newbie


Joined: 29 December 2003
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote JDonovan Quote  Post ReplyReply Direct Link To This Post Topic: Password Fields
    Posted: 29 December 2003 at 9:08pm

Is there an easy way to add a password protected edit control in a Property Grid? I added my own custom edit control without problem (all based on the CustomItems code supplied from CodeJock), and this control is a CEdit with the ES_PASSWORD flag on. It works great at initialization and when editing the text, but as soon as focus goes to another section the *actual* text is written back to the grid cell. I really need to use this with password protection on some of the fields, any help would be appreciated.

Thanks!

 

- Jeffrey Donovan

 

 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 30 December 2003 at 1:26am

override OnDrawItemValue:

 

BOOL CCustomItemIcon::OnDrawItemValue(CDC& dc, CRect rcValue)
{

CString strPassword = {"*" * length(m_strValue)} 

 dc.DrawText( strPassword, rcValue,  DT_SINGLELINE|DT_VCENTER);

 return TRUE;
}

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
JDonovan View Drop Down
Newbie
Newbie


Joined: 29 December 2003
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote JDonovan Quote  Post ReplyReply Direct Link To This Post Posted: 30 December 2003 at 6:13am

Perfect!

 

Thanks so much for the help and fast response Oleg, appreciate it muchly.

 

- Jeffrey Donovan

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.