Ahmed Elsaeed
Ahmed Elsaeed

Reputation: 13

Change the color of an inputdlg field name

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?

Upvotes: 1

Views: 170

Answers (1)

Dev-iL
Dev-iL

Reputation: 24169

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

Upvotes: 4

Related Questions