retinax
asked on
Run a C# .NET Compact Framework Application in Background
Hi,
I am writing a SMS/Contact backup application, it need to run in the background (may be with an icon in the notification area)? What can I do to achieve it? Say FormBackup need to stay in memory, with a timer, that checks for new SMS etc and does the backup. How can I prevent user from clicking the X button to close it, and only Hide the form.
Thanks
I am writing a SMS/Contact backup application, it need to run in the background (may be with an icon in the notification area)? What can I do to achieve it? Say FormBackup need to stay in memory, with a timer, that checks for new SMS etc and does the backup. How can I prevent user from clicking the X button to close it, and only Hide the form.
Thanks
ASKER
Ok cool, thanks.
Any idea on the Notification area icon thing?
Any idea on the Notification area icon thing?
Create NotifyIcon and ContextMenuStrip controls on the form.
Set setNotifyIcon's ContextMenuStrip property to your context menu.
Set NotifyIcon's Icon property to icon of your choice and set it's Visible property to true.
Create a 'Show form' menu in your context menu strip and fill it with this code:
Set setNotifyIcon's ContextMenuStrip property to your context menu.
Set NotifyIcon's Icon property to icon of your choice and set it's Visible property to true.
Create a 'Show form' menu in your context menu strip and fill it with this code:
private void showFormToolStripMenuItem_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Normal;
this.Visible = true;
}
ASKER
Thanks, are those controls available only in WM6 professional sdk not standard edition??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
this.ControlBox = false; // Hides the minimize, X etc at the top of your form
this.Hide(); // Will hide the form