Changing color of a string in listbox - MATLAB GUI
显示 更早的评论
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
采纳的回答
更多回答(6 个)
Tom
2012-6-14
1 个投票
You can do it with html- see http://undocumentedmatlab.com/blog/html-support-in-matlab-uicomponents/
Vincent I
2012-6-14
0 个投票
1 个评论
Dr. Seis
2012-6-14
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
2012-6-18
0 个投票
5 个评论
Walter Roberson
2012-6-18
The code I gave puts the entry back in the same place it was.
Walter Roberson
2012-6-18
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
2012-6-18
Vincent I
2012-6-18
Walter Roberson
2012-6-18
<FONT color="cyan">
Vincent I
2012-6-18
0 个投票
1 个评论
Walter Roberson
2012-6-18
namestr(validx) = []; %delete it from where it was
namestr = [ {newstr}; namestr ];
类别
在 帮助中心 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!