How do I obtain the starting and ending character position in a text box that a user is highlighting?

1 次查看(过去 30 天)
I have a large edit box in gui that I used to display the contents of a text file to the user. The user can then highlight a number in the text and press a gui button to "record the text". If the text box tag was "eb_filetext", in versions up to matlab 2014 I used the following 3 commands to achieve this task:
begins = handles.eb_filetext_java.getSelectionStart()
ends = handles.eb_filetext_java.getSelectionEnd()
selection = char(handles.eb_filetext_java.getSelectedText())
Versions 2016 and up, this function is broken. These few lines of code are critical to the operation of a 15,000 line GUI that was developed. How can I replace/update this code! Help!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by