Thursday, June 24, 2004

SystemIcon to Icon - Take 2

After my last post, I took a look at a standard XP icon as opposed to what I was able to get. My "improvement" still left room for lots of improvement. So, I decided to get my hands dirty. I got rid of the PictureBox control entirely. Instead, I went with a lowly panel and set up a handler for the panel's Paint event.

So I have an Icon object that came from SystemIcons and I'm in the Paint handler. I do a little bit of math using size property properties from the Icon and Panel. From the PaintEventArgs, I get a good Graphics. Graphics.DrawIcon is the method you want. Bam! It's now good as the guys in Redmond can do.

Time burnt getting a system icon on a dialog box: 4 hours.

0 Comments:

Post a Comment

<< Home