thepip3r
thepip3r

Reputation: 2935

PowerShell/.NET 4 GUIs - Internal Windows Icons?

Let me preface this question with first stating that I'm new to GUI interfaces: what's available, what can/can't be done, etc. With that being said, here we go!

I'm writing a PowerShell gui using System.Windows.Form objects and wanted to know if there are ICONS available in some inherent library available in Windows that I can invoke programmatically so that I don't have to manually create?

As an example, I'm looking to add little question-mark "?" icons next to some of my fields that would serve as like a mouse-over style help explaining specifics about x or y field.

Does such a thing exist? If so, does anyone have a good doc on what icons are available and how to invoke them in PowerShell? If not, does anyone have a solid work-around for what I'm describing?

Edit:

So I found out how to do this. You use the System.Drawing.SystemIcons and assign the invoked icon into the .Icon property of an object (if it has one).

form1.Icon = [System.Drawing.SystemIcons]::Question

I was hoping for something I could use in any control but I suppose this will work.

Upvotes: 4

Views: 5236

Answers (3)

Start-Automating
Start-Automating

Reputation: 8377

One trick I've found is the use of the Webdings and Wingdings fonts. Both are universally available on about every OS/SKU since 2000. They have an astounding amount of simple iconography you can pick from.

I'll do a blog post describing some of the ones I've found and add a comment with a link.

Hope this Helps

Upvotes: 0

JPBlanc
JPBlanc

Reputation: 72680

On each windows system you can find ressource files with icons used by the shell Explorer.exe.

From Windows NT 3.1 to 5.2 (W2K3 or XP) ressources are in :

C:\Windows\System32\Shell32.dll

Beginig NT 6.0 (Vista) they are in :

C:\Windows\System32\Imageres.dll

You can open these files with Visual Studio as ressources files to find the Shell Icons you need.

Upvotes: 0

djdanlib
djdanlib

Reputation: 22566

There sure is such a thing. I used it to create a MessageBox with selectable and copyable text once. You're looking for the System.Drawing.SystemIcons class: http://msdn.microsoft.com/en-us/library/system.drawing.systemicons.aspx

Here are some guidelines to using such icons: http://msdn.microsoft.com/en-us/library/aa511277.aspx

Upvotes: 4

Related Questions