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

35 次查看(过去 30 天)
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.

更多回答(2 个)

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!

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 中查找有关 Desktop 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by