How can I change the icon of my AppDesigner-produced GUIs?

조회 수: 46 (최근 30일)
Micke Malmström
Micke Malmström 2018년 3월 19일
편집: li li 2021년 12월 11일
I would like to easily distinguage my GUI from the figures when pressing Alt+Tab so I can access it faster. Now when I run the GUIs they have the same icon as a regular figure...
  댓글 수: 4
Marc McLean
Marc McLean 2019년 4월 19일
How do you change the icon in the upper left of the .mlappp GUI launched from AppDesigner?
icon.jpg

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

채택된 답변

Cris LaPierre
Cris LaPierre 2020년 10월 29일
Starting with R2020b, you can now specify custom icons for UI figure windows and toolbar push and toggle tools. See the release notes here.

추가 답변 (3개)

li li
li li 2021년 12월 11일
편집: li li 2021년 12월 11일
R2020b OR Last version
function startupFcn(app)
app.uifigure .Icon='logo.png';
end
OK!

Cris LaPierre
Cris LaPierre 2019년 4월 20일
편집: Cris LaPierre 2020년 10월 29일
R2020b update: See this answer.
  댓글 수: 1
Micke Malmström
Micke Malmström 2020년 3월 5일
Note that I dont want to change the icon of the Matlab application (which "this answer" says you cant and which is understandable). I only want to change the icon of one particular figure window, so that I can find it easily when I have >25 figures open at the same time.

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


Robert
Robert 2020년 10월 29일
Add this to your startupFcn:
t = 0;
tMax = 5;
dt = 0.1;
while ~isfield(struct(struct(app.UIFigure).Controller), 'PlatformHost') && t < tMax
% Keep waiting until the window is found.
t = t + dt;
pause(dt)
end
win = struct(struct(struct(app.UIFigure).Controller).PlatformHost).CEF;
win.Icon = 'C:\Folder\MyIcon.ico';
Of course, you may have renamed the UIFIgure property of your app.
In R2016b and older, replace 'PlatformHost' with 'Container'.

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by