Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 876039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:22:04+00:00 2026-05-15T11:22:04+00:00

In particular I’d like to be able to get the small (16 x 16)

  • 0

In particular I’d like to be able to get the small (16 x 16) icons at runtime.

I tried this:

new Icon(SystemIcons.Error, SystemInformation.SmallIconSize)

Which supposedly “attempts to find a version of the icon that matches the requested size”, but it’s still giving me a 32 x 32 icon. I also tried:

Size iconSize = SystemInformation.SmallIconSize;
Bitmap bitmap = new Bitmap(iconSize.Width, iconSize.Height);
using (Graphics g = Graphics.FromImage(bitmap))
{
    g.DrawIcon(SystemIcons.Error, new Rectangle(Point.Empty, iconSize));
}

But that just scales the 32 x 32 icon down into an ugly 16 x 16.

I’ve considered just pulling icons out of the VS Image Library, but I really want them to vary dynamically with the OS (XP icons on XP, Vista icons on Vista, etc.). I’m willing to P/Invoke if that’s what it takes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:22:05+00:00Added an answer on May 15, 2026 at 11:22 am

    I wound up P/Invoking. It turns out that both LoadIcon and LoadImage exhibit the same (flawed, IMO) behavior as SystemIcons. But SHGetStockIconInfo, which is available on Vista and later, works as expected, returning the small, official, designer-crafted icons that I’ve been looking for.

    On XP and earlier, I’m falling back to using the small icons provided in the VS Image Library.

    If you’re thinking about P/Invoking SHGetStockIconInfo yourself, I recommend taking a look at the Windows API Code Pack to see how.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The particular case I have is like this: I have a Transaction model, with
In particular, I would like to be able to access the user_id and group_id
This particular example is Get-User and Get-Mailbox (Exchange 2010). Get-User returns some of the
In particular, is this possible with Javascript? >> Version 1.2.3.4.match(/\S+ (\d+)(\.\d+)*/) [Version 1.2.3.4, 1,
Apologize if this particular problem has been answered already (a search didn't turn anything
This particular page works on Firefox and Chrome. On IE9, I am getting this
This particular assignment has to do with removing substrings from strings; I am trying
In particular I'm interested in shortStandaloneWeekdaySymbols . I'm using this code: NSDateFormatter *dateFormatter =
This particular problem is easy to solve, but I'm not so sure that the
In particular I would like to know how to bind the 'SelectionChanged' event of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.