Cursor position in the edit window using GUIDE
조회 수: 11 (최근 30일)
이전 댓글 표시
Hello, I am using KeyPressFunction for my edit text uicontrol to replace input characters with the string of "*". However, every time I set the string the cursor always goes at the beginning of the string. Is there any way to send it at the end? I know there is a "\r" special character, is there any special character that does the opposite? I have found some solutions which use actxcontrol, but I am trying to avoid that.
Here is the code snippet:
if true
function edit_pass_KeyPressFcn(hObject, eventdata, handles)
acceptable_characters=char([65:90 97:122]);
if strfind(acceptable_characters,eventdata.Character)
handles.password=[handles.password eventdata.Character];
dummy_str=char(42*ones(1,length(handles.password)));
set(handles.edit_pass,'String', dummy_str);
end
guidata(hObject,handles);
end
Thank you!
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!