필터 지우기
필터 지우기

i want to copy the data of the edit text button in my gui and use it in other push button can i do that ?

조회 수: 1 (최근 30일)
[filename]=uigetfile({'*.txt'},'FILE Selector');
Path=filename;
text=fileread(Path);
set(handles.edit2,'string',text);

답변 (2개)

Walter Roberson
Walter Roberson 2015년 6월 1일
set(handles.edit3,'string',get(handles.edit2,'string'));
  댓글 수: 3

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2015년 6월 1일
All callbacks have access to any properties of any widget on your user interface. So, in the callback of your other push button, simply do
editFieldText = get(handles.edit2, 'String');
Now that callback can use editFieldText as a string in anyway that it wants.
If you need that edit field string in a custom function that you wrote, instead of a callback, then you need to pass in the handles structure.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by