Exemple #1
0
 private void SafelyAddIcon(string fullFileName)
 {
     try
     {
         if (!imageListUnits.Images.ContainsKey(fullFileName))
         {
             imageListUnits.Images.Add(fullFileName, ExtractIcon.GetIconForFilename(fullFileName, true).ToBitmap());
         }
     }
     catch { }
 }
Exemple #2
0
        public MainForm()
        {
            // Force use of Segou UI Font in Vista and above
            // But this makes a mess of the layouts when they are autoscaled !!!
            //if (SystemFonts.MessageBoxFont.Size >= 9)
            //   Font = SystemFonts.MessageBoxFont;

            InitializeComponent();
            Icon icon = ExtractIcon.GetIconForFilename(Environment.GetFolderPath(Environment.SpecialFolder.MyComputer), true);

            imageListUnits.Images.Add("MyComputer", icon.ToBitmap());
            versionNumberToolStripMenuItem.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString();
        }