Load file system icon at runtime C#
I have some C# code to get a icon from an embedded resource that works fine using a URI.
MyIcon = new System.Windows.Forms.NotifyIcon();
Stream iconStream = Application.GetResourceStream(
new Uri("pack://application:,,,/uif/tiles/Interface.ico")).Stream;
MyIcon.Icon = new System.Drawing.Icon(iconStream);
I want to achieve the same but with a icon from the file system c:\red.ico
Try this:
MyIcon.Icon = new System.Drawing.Icon("Your filepath");