Datafields

From Team Developer SqlWindows Wiki
Jump to: navigation, search

Datafield


Contents


Pointer2.png How to set/get password display character Pointer.png

For default, the display character for password fields is an asterisk (*).
You can set this to another character.

First define these constants

Number: ES_PASSWORD           = 0x0020
Number: EM_SETPASSWORDCHAR    = 0xCC
Number: EM_GETPASSWORDCHAR    = 0xD2

Now, here the code to set a datafield to display the text to password style:

Data Field: dfPassword
   Message Actions
      On VTM_Create
         Call VisWinSetStyle( hWndItem, ES_PASSWORD, TRUE )

And here the code to change the display character:

   ! nChar = ASCII character value
   Set nChar = 64  ! 64 = '@'
   Call SalSendMsg( dfPassword, EM_SETPASSWORDCHAR, nChar, 0 )
   Call SalInvalidateWindow( dfPassword )
   !
   ! Here get the current display character
   Set nChar = SalSendMsg( dfPassword, EM_GETPASSWORDCHAR, 0, 0 )

When you set no display character (value = 0), then the text in the datafield will display the 'normal' text.

PasswordCharacter.png


Here you can download a sample:
Down.png WIKI_ChangePasswordCharacter.zip