Borrar filtros
Borrar filtros

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 visualización (últimos 30 días)
[filename]=uigetfile({'*.txt'},'FILE Selector');
Path=filename;
text=fileread(Path);
set(handles.edit2,'string',text);

Respuestas (2)

Walter Roberson
Walter Roberson el 1 de Jun. de 2015
set(handles.edit3,'string',get(handles.edit2,'string'));
  3 comentarios

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 1 de Jun. de 2015
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.

Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by