# VBForums CodeBank > CodeBank - Visual Basic .NET >  Get the system icons (messagebox icons) by code

## MrPolite

I didnt know it was this easy to access them. Just look at the System.Drawing.SystemIcons namespace. For example

System.Drawing.SystemIcons.Error.ToBitmap will return the error icon shown in a messagebox 
hope this will be helpful to some people

----------


## crpietschmann

> _Originally posted by crpietschmann_ 
> *Here is an example of how to make a system icon the icon of a form.
> 
> 
> ```
> Me.Icon = System.Drawing.SystemIcons.Information
> ```
> 
> It's that simple.*

----------


## dynamic_sysop

*big thanks to MrPolite for finding the Systemicons ( pointing them out ).*
here's some code i built to show how to get all the system icons without having to type each one out....

VB Code:
Dim mi As Reflection.MemberInfo() = GetType(Drawing.SystemIcons).GetMembers
        Dim m As Reflection.MemberInfo
        For Each m In mi
            If m.MemberType = Reflection.MemberTypes.Property Then
                Dim o As Object = m.ReflectedType.InvokeMember(m.Name, Reflection.BindingFlags.GetProperty, Nothing, o, Nothing)
                If TypeOf o Is Icon Then
                    Me.Icon = DirectCast(o, Icon)
                    Threading.Thread.Sleep(500) '/// just to give you time to see your form's icon change through each system icon.
                End If
            End If
        Next

----------

