Borrar filtros
Borrar filtros

How to create an inputdlg with a portion of the default text already selected?

3 visualizaciones (últimos 30 días)
I'd like to create an input dialog box where a subset of the default text is already selected so that the user will overwrite it by beginning to type. Has anyone managed to make something like this work without creating your own gui in GUIDE or AppBuilder?

Respuestas (1)

Mischa Kim
Mischa Kim el 7 de Sept. de 2016
Editada: Mischa Kim el 7 de Sept. de 2016
David, do you mean something like
prompt = {'Enter matrix size:','Enter colormap name:'};
dlg_title = 'Input';
num_lines = 1;
defaultans = {'20',''};
answer = inputdlg(prompt,dlg_title,num_lines,defaultans);
This is an adapted example from the MathWorks documentation .
  1 comentario
David Fergenson
David Fergenson el 7 de Sept. de 2016
Thanks, Mischa. I mean something like that but, for example, with the '2' in '20' highlighted but the '0' not highlighted. For example:
answer = inputdlg('Type something here', 'Type', 1, {'Highlight this... but not this'
Obviously, I'd like the 'Highlight this...' to be selected and the ' but not this' to not be selected. Do you know if this is possible or is this something where I'm just going to have to design my own dialog box?

Iniciar sesión para comentar.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by