Password support

Does the sttextboxext control allow you to use it for inputing a password? 
Thanks

1 Reply 1 reply marked as answer

SS Suganya Sethuraman Syncfusion Team January 19, 2021 06:34 AM UTC

Hi George,

Greetings from Syncfusion.

We have checked your requirement in SfTextBoxExt. Currently we don’t have a direct support for achieving your requirement. But we have achieved your requirement in SfTextBoxExt by using TextChanged event with initially assigned the predefined hint character as per in below code snippet,

Code Snippet [XAML]

 
<editors:SfTextBoxExt x:Name="textBox"   
                              HorizontalAlignment="Center"   
                              VerticalAlignment="Center"   
                              Width="400"   
                              MaxLength="16"  
                              TextChanged="SfTextBoxExt_TextChanged"/>  
 


We have prepared this sample in the case of entering the Debit card number. Hence, we have restricted length of the text by using MaxLength.

Code Snippet [C#]:

 
  private void SfTextBoxExt_TextChanged(object sender, TextChangedEventArgs e)  
        {  
            if (maskTextCount >= textBox.Text.Length)  
            {  
                textBox.Text = originalText.Substring(originalText.Length - textBox.Text.Length);  
            }  
  
            textBox.CaretIndex = textBox.Text.Length;  
        }  
 


CaretIndex is used to change the position of cursor in SfTextBoxExt after entering the text.

We have a prepared the sample. Please download the same in below link,

Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/TextBoxExt_WPF377630054

Output:



Please check with above sample and let us know if you have any concern on this.

Regards,
Suganya Sethuraman.
 


Marked as answer
Loader.
Up arrow icon