Hi Guys
here simple sample how to use the system state class in windows mobile.
Question: How to check the cradlepresent in the Windows mobile Device or Emulator ?
Answers:
SystemState cradleState = null;
private void Init()
{
cradleState = new SystemState(SystemProperty.CradlePresent);
cradleState.Changed += new ChangeEventHandler(cradleState_Changed);
}
void cradleState_Changed(object sender, ChangeEventArgs args)
{
bool isPresent =Convert.ToBoolean(SystemState.GetValue(SystemProperty.CradlePresent));
if (isPresent)
{
MessageBox.Show("Present");
}
}
thank you
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment