Change the color of an inputdlg field name

157 views Asked by At

This is my code:

classDefault={'','','','',''};
fieldNames= {'Class Number','Class Name'};
title='Enter Class Information';
numlines=1;  
y =inputdlg(fieldNames,title,numlines,classDefault);

it shows:

enter image description here

I want to change the color of the field name, like this:

enter image description here

How can I do this?

1

There are 1 answers

1
Dev-iL On BEST ANSWER

You can use the tex interpreter:

function q65234922()
classDefault = {'','','','',''};
fieldNames = {'\color{red}Class Number','Class Name'};     % Change 1
title = 'Enter Class Information';
numlines = 1;
opts = struct('Interpreter','tex');                        % Change 2
y = inputdlg(fieldNames,title,numlines,classDefault,opts); % Change 3

enter image description here