How can I change the icon of my AppDesigner-produced GUIs?
Show older comments
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 Comments
Image Analyst
on 19 Mar 2018
Exactly where is the icon appearing? In MATLAB? On your desktop? In File Explorer? For a program you compiled into a standalone executable? Attach a screenshot.
Micke Malmström
on 20 Mar 2018
Marc McLean
on 19 Apr 2019
How do you change the icon in the upper left of the .mlappp GUI launched from AppDesigner?
Mohammed Majid Msallam
on 4 Mar 2020
also me
Accepted Answer
More Answers (2)
R2020b OR Last version
function startupFcn(app)
app.uifigure .Icon='logo.png';
end
OK!
Robert
on 29 Oct 2020
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'.
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!