Share via


Notification.Icon Property

Gets or sets the current icon for the message balloon on the title bar.

Namespace: Microsoft.WindowsCE.Forms
Assembly: Microsoft.WindowsCE.Forms (in microsoft.windowsce.forms.dll)

Syntax

'Declaration
Public Property Icon As Icon
'Usage
Dim instance As Notification
Dim value As Icon

value = instance.Icon

instance.Icon = value
public Icon Icon { get; set; }
public:
property Icon^ Icon {
    Icon^ get ();
    void set (Icon^ value);
}
/** @property */
public Icon get_Icon ()

/** @property */
public void set_Icon (Icon value)
public function get Icon () : Icon

public function set Icon (value : Icon)
Not applicable.

Property Value

An Icon. There is no default value.

Remarks

You can provide an icon file in your project either as content or as an embedded resource. To do this in Visual Studio, in the Solution Explorer, set the Build Action property of the icon file to either Content or Embedded Resource.

The recommended value for both the height and width of the icon is 16 pixels.

Example

The following code example creates a notification and initializes a new instance of the Icon class using a data stream from an assembly resource. This code example is part of a larger example provided for the Notification class.

 'Provide an icon for the notification to appear in the title bar when dismissed.
 'Assumes an icon file is compiled with the assembly as an embedded resource.
 Dim asm As [Assembly] = [Assembly].GetExecutingAssembly()
Notification1.Icon = New Icon(asm.GetManifestResourceStream("notify.ico"), 16, 16)
 // Provide an icon for the notification to appear in the title bar when dismissed.
 // Assumes an icon file is compiled with the assembly as an embedded resource.
Assembly asm = Assembly.GetExecutingAssembly();
notification1.Icon = new Icon(asm.GetManifestResourceStream("notify.ico"),16,16);

Platforms

Windows Mobile for Pocket PC

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Compact Framework

Supported in: 2.0

See Also

Reference

Notification Class
Notification Members
Microsoft.WindowsCE.Forms Namespace