Datafields

From TeamDeveloperWiki

Jump to: navigation, search

This page covers Datafield tips & tricks.

Contents


Image:Pointer.pngHow to set/get password display character

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.

Here you can download a sample:



Image:Pointer.pngEnter new tip title here

Enter new tip description here

Personal tools