SystemState.Changed Event

Windows Mobile 6.5

Event that is raised when the state changes.

Namespace: Microsoft.WindowsMobile.Status
Assembly: Microsoft.WindowsMobile.Status (in microsoft.windowsmobile.status.dll)

public override event ChangeEventHandler Changed

The following example shows how to enable the Changed event to be raised when the battery strength changes:

SystemState batteryStrength = new SystemState(SystemProperty.PowerBatteryStrength);

private void Form1_Load(object sender, EventArgs e)
    batteryStrength.Changed += new ChangeEventHandler(batteryStrength_Changed);

void batteryStrength_Changed(object sender, ChangeEventArgs args)
     BatteryLevel batteryLevel = (BatteryLevel)args.NewValue;

This event will be raised only during the lifetime of the SystemState object.