Browse Source

处理图像不存在的BUG

章政 7 years ago
parent
commit
6f69b23020
1 changed files with 8 additions and 1 deletions
  1. 8 1
      UAS_MES_NEW/CustomControl/AccordionMenu/NavagationBar.cs

+ 8 - 1
UAS_MES_NEW/CustomControl/AccordionMenu/NavagationBar.cs

@@ -92,7 +92,14 @@ namespace UAS_MES_NEW.CustomControl.AccordionMenu
                     }
                     catch (Exception)
                     {
-                        nbg.LargeImage = new Bitmap(@Application.StartupPath + "/Resources/defaulticon.png");
+                        try
+                        {
+                            nbg.LargeImage = new Bitmap(@Application.StartupPath + "/Resources/defaulticon.png");
+                        }
+                        catch (Exception)
+                        {
+                            nbg.ImageUri = null;
+                        }
                     }
                     Groups.Add(nbg);
                     nbg.ItemLinks.Add(nbi);