Changing color of a string in listbox - MATLAB GUI
Mostrar comentarios más antiguos
I have a list of names in a listbox. What I would like to do is have a certain selected name change color, from red to green, when I click a button.
Thank you
Respuesta aceptada
Más respuestas (6)
Tom
el 14 de Jun. de 2012
1 voto
You can do it with html- see http://undocumentedmatlab.com/blog/html-support-in-matlab-uicomponents/
Vincent I
el 14 de Jun. de 2012
0 votos
1 comentario
Dr. Seis
el 14 de Jun. de 2012
What you are generally describing above should work with HTML... can you post a few pictures of what you envision? Or can you post the cell-string you are using to apply to the listbox... there might be a formatting issue that is preventing it from working.
Vincent I
el 18 de Jun. de 2012
0 votos
5 comentarios
Walter Roberson
el 18 de Jun. de 2012
The code I gave puts the entry back in the same place it was.
Walter Roberson
el 18 de Jun. de 2012
Record the Value before you clear it. assign contents{} at that value to be the new line. set() the String to be the changed "contents" cell array.
Vincent I
el 18 de Jun. de 2012
Vincent I
el 18 de Jun. de 2012
Walter Roberson
el 18 de Jun. de 2012
<FONT color="cyan">
Vincent I
el 18 de Jun. de 2012
0 votos
Vincent I
el 18 de Jun. de 2012
0 votos
1 comentario
Walter Roberson
el 18 de Jun. de 2012
namestr(validx) = []; %delete it from where it was
namestr = [ {newstr}; namestr ];
Categorías
Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!