adrakadabra
adrakadabra

Reputation: 443

where can i find toolbox icon for visual studio?

i need icon(image) of all controls in toolbox in visual studio.is there any link that i can use ?

Upvotes: 1

Views: 1280

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038830

Icons are stored as an embedded resource in the corresponding .NET assembly hosting the control. So there's no link that you can use. You will need to extract it from the assembly. For example to extract the icon for a button from the System.Windows.Forms assembly you could use this:

    var assembly = Assembly.Load("System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
    using (var stream = assembly.GetManifestResourceStream("System.Windows.Forms.Button.bmp"))
    using (var reader = new BinaryReader(stream))
    {
        byte[] image = reader.ReadBytes((int)stream.Length);
        File.WriteAllBytes("button.bmp", image);
    }

Upvotes: 2

Related Questions