how to see the typed letter in GUI
Afficher commentaires plus anciens
I have acode below (in key press function) GUI
password = get(handles.edit1,'String');
key = get(handles.figure1,'currentkey');
key1=get(handles.figure1,'currentcharacter')
switch key
case 'backspace'
password = password(1:end-1); % Delete the last character in the password
otherwise
password = [password get(handles.figure1,'currentcharacter')] % Add the typed character to the password
end
SizePass = size(password) % Find the number of asterisks
if SizePass(2) > 0
asterisk(1,1:SizePass(2)) = '*'; % Create a string of asterisks the same size as the password
set(handles.edit1,'String',asterisk) % Set the text in the password edit box to the asterisk string
else
set(handles.edit1,'String','')
end
I have created a GUI with one edit boxThe above code is to mask the typed letter in edit box into asterisk,but i cannot see the typed password,then the variable password ,if i have typed 123 in edit box,the edit box show 3 asterisk but in that variable password it shows **3,y i get like this
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Interactive Control and Callbacks dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!