Difference between revisions of "Datafields"

From Team Developer SqlWindows Wiki
Jump to: navigation, search
(New page: This page covers datafield tips & tricks. __TOC__ <br> <h2 style="margin:0;background-color:#ddcef2;font-size:120%;font-weight:bold;border:1px solid #afa3bf;text-align:left;color:#000;pa...)
 
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
This page covers datafield tips & tricks.
+
{{PageHeader|Datafield}}
 +
 
  
 
__TOC__
 
__TOC__
 +
 +
 +
<!------------------------------------------------------------------------------------------------------------------------------>
 +
{{TipHeader|How to set/get password display character}}
 +
For default, the display character for password fields is an asterisk (*).<br>
 +
You can set this to another character.<br>
 
<br>
 
<br>
 +
First define these constants
 +
 +
<pre>
 +
Number: ES_PASSWORD          = 0x0020
 +
Number: EM_SETPASSWORDCHAR    = 0xCC
 +
Number: EM_GETPASSWORDCHAR    = 0xD2
 +
</pre>
 +
 +
Now, here the code to set a datafield to display the text to password style:
 +
<pre>
 +
Data Field: dfPassword
 +
  Message Actions
 +
      On VTM_Create
 +
        Call VisWinSetStyle( hWndItem, ES_PASSWORD, TRUE )
 +
</pre>
 +
 +
And here the code to change the display character:
 +
 +
<pre>
 +
  ! 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 )
 +
</pre>
 +
 +
When you set no display character (value = 0), then the text in the datafield will display the 'normal' text.<br>
 +
<br>
 +
[[image:PasswordCharacter.png]]
 +
 +
 +
Here you can download a sample:<br>
 +
{{Download
 +
|URL=http://samples.tdcommunity.net/index.php?dir=&file=WIKI_ChangePasswordCharacter.zip
 +
|TEXT=WIKI_ChangePasswordCharacter.zip
 +
}}
 +
 +
  
<h2 style="margin:0;background-color:#ddcef2;font-size:120%;font-weight:bold;border:1px solid #afa3bf;text-align:left;color:#000;padding:0.2em 0.4em;">[[Image:Pointer.png]]Enter new tip title here</h2>
+
[[Category:Child Objects]]
Enter new tip description here
+

Latest revision as of 10:49, 29 October 2013

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