필터 지우기
필터 지우기

Multiple lines in msgbox

조회 수: 72 (최근 30일)
Amani
Amani 2011년 12월 24일
댓글: Image Analyst 2018년 12월 19일
How can i write multiple lines in msgbox ?
here it is just write in 2 lines ! .. but i need more than 2 lines : (
uiwait(msgbox({'line1';'line2' } ,'About !','modal'));
  댓글 수: 1
Image Analyst
Image Analyst 2018년 9월 19일
Isn't that basically just what Walter already said below (7 years ago)?

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2011년 12월 24일
uiwait(msgbox({'line1';'line2';'line3';'line4' } ,'About !','modal'));
  댓글 수: 1
Amani
Amani 2011년 12월 24일
Thanxxxxx alote walter ^_^

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2011년 12월 24일
message = sprintf('Line1\nLine2\nLine3\nLine4');
uiwait(msgbox(message));
  댓글 수: 2
Le Dung
Le Dung 2018년 12월 19일
How can i change fontsize or color of line1,line2....line4 in msgbox???
Thank you so much
Image Analyst
Image Analyst 2018년 12월 19일
You have to create a structure that you pass in to msgbox(). See this function msgboxw() that puts up a message with fontsize 14. Adapt as needed.
function msgboxw(message)
try
CreateStruct.Interpreter = 'tex';
CreateStruct.WindowStyle = 'modal';
% CreateStruct.Title = 'MATLAB Message';
fontSize = 14;
% Embed the required tex code in before the string.
latexMessage = sprintf('\\fontsize{%d} %s', fontSize, message);
uiwait(msgbox(latexMessage, 'MATLAB message', CreateStruct));
catch ME
errorMessage = sprintf('Error in msgboxw():\n%s', ME.message);
fprintf('%s\n', errorMessage);
uiwait(warndlg(errorMessage));
end
return; % from msgboxw()

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by