The opinions expressed herein are my own personal opinions. They are not necessarily fact or sactioned by any other person or organization. If you disagree that's your right. It's also my right to not care.
© Copyright 2010, Chris Tacke
There's a thread in the newsgroups where someone is trying to show a Notification before his app does some long-running process. Here's an example of how it's done.
using System.Threading;using Microsoft.WindowsCE.Forms;
public partial class Form1 : Form{ public Form1() { InitializeComponent(); workButton.Click += new System.EventHandler(workButton_Click); } delegate void EventDelegate(); Notification m_workNotify = new Notification(); Control m_invoker = new Control(); EventDelegate m_workCompleteDelegate; private void workButton_Click(object sender, EventArgs e) { // disable the button so it can't be clicked again until work is done workButton.Enabled = false; m_workCompleteDelegate = new EventDelegate(OnWorkComplete); Thread workThread = new Thread(new ThreadStart(WorkProc)); m_workNotify.Text = "I'm doing important stuff"; m_workNotify.Caption = "Please wait..."; m_workNotify.InitialDuration = 5; m_workNotify.Visible = true; workThread.Start(); } void OnWorkComplete() { // re-enable the button workButton.Enabled = true; } void WorkProc() { // simulate working Thread.Sleep(20000); m_invoker.Invoke(m_workCompleteDelegate); }}
Remember Me