menu items

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tawanda diza
    New Member
    • Sep 2011
    • 29

    menu items

    hie all

    May someone please help me on how to view other events on the menu-items, i have got a dialog that has menu-items on it and the only events that are there are : click and PopUp. i am developing windows CE applications using c#.

    i am stopping a timer on PopUp event and i want it to start again as soon as the menu item has been closed.

    is there any where that i can put this timer code to start it.
  • adriancs
    New Member
    • Apr 2011
    • 122

    #2
    I'm not sure what do you want.

    However, you may look at this about starting the timer before & after opening a form.
    Code:
    public partial class Form1 : Form
    {
        Timer timer1;
        public Form1()
        {
            InitializeComponent();
            timer1 = new Timer();
            timer1.Interval = 500;
            timer1.Tick += new EventHandler(timer1_Tick);
        }
    
        void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Stop();
            MessageBox.Show("Hello World!");
        }
    
        private void menuItem1ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // start the timer before opening a form
            timer1.Start();
            Form2 f = new Form2();
            f.ShowDialog();
            // start the timer after closing the form
            timer1.Start();
        }
    }

    Comment

    Working...