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

36 vues (au cours des 30 derniers jours)
Micke Malmström
Micke Malmström le 19 Mar 2018
Commenté : Cris LaPierre le 11 Juil 2025
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 commentaires
Marc McLean
Marc McLean le 19 Avr 2019
How do you change the icon in the upper left of the .mlappp GUI launched from AppDesigner?
icon.jpg
Mohammed Majid Msallam
Mohammed Majid Msallam le 4 Mar 2020
also me

Connectez-vous pour commenter.

Réponse acceptée

Cris LaPierre
Cris LaPierre le 29 Oct 2020
Starting with R2020b, you can now specify custom icons for UI figure windows and toolbar push and toggle tools. See the release notes here.
  1 commentaire
Cris LaPierre
Cris LaPierre le 11 Juil 2025
The Icon property became available in regular figures starting in R2025a. See here.

Connectez-vous pour commenter.

Plus de réponses (2)

li li
li li le 11 Déc 2021
Modifié(e) : li li le 11 Déc 2021
R2020b OR Last version
function startupFcn(app)
app.uifigure .Icon='logo.png';
end
OK!

Robert
Robert le 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'.

Catégories

En savoir plus sur Desktop dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by