473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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.
Dec 13 '11 #1

✓ answered by adriancs

I'm not sure what do you want.

However, you may look at this about starting the timer before & after opening a form.
Expand|Select|Wrap|Line Numbers
  1. public partial class Form1 : Form
  2. {
  3.     Timer timer1;
  4.     public Form1()
  5.     {
  6.         InitializeComponent();
  7.         timer1 = new Timer();
  8.         timer1.Interval = 500;
  9.         timer1.Tick += new EventHandler(timer1_Tick);
  10.     }
  11.  
  12.     void timer1_Tick(object sender, EventArgs e)
  13.     {
  14.         timer1.Stop();
  15.         MessageBox.Show("Hello World!");
  16.     }
  17.  
  18.     private void menuItem1ToolStripMenuItem_Click(object sender, EventArgs e)
  19.     {
  20.         // start the timer before opening a form
  21.         timer1.Start();
  22.         Form2 f = new Form2();
  23.         f.ShowDialog();
  24.         // start the timer after closing the form
  25.         timer1.Start();
  26.     }
  27. }

1 1674
adriancs
122 100+
I'm not sure what do you want.

However, you may look at this about starting the timer before & after opening a form.
Expand|Select|Wrap|Line Numbers
  1. public partial class Form1 : Form
  2. {
  3.     Timer timer1;
  4.     public Form1()
  5.     {
  6.         InitializeComponent();
  7.         timer1 = new Timer();
  8.         timer1.Interval = 500;
  9.         timer1.Tick += new EventHandler(timer1_Tick);
  10.     }
  11.  
  12.     void timer1_Tick(object sender, EventArgs e)
  13.     {
  14.         timer1.Stop();
  15.         MessageBox.Show("Hello World!");
  16.     }
  17.  
  18.     private void menuItem1ToolStripMenuItem_Click(object sender, EventArgs e)
  19.     {
  20.         // start the timer before opening a form
  21.         timer1.Start();
  22.         Form2 f = new Form2();
  23.         f.ShowDialog();
  24.         // start the timer after closing the form
  25.         timer1.Start();
  26.     }
  27. }
Dec 14 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Heather | last post by:
I notice the Tag property for menu items. Is there a way to assign say a 1 to the Tag property of certain menu items and then make those menu items not visible programatically? Thanks! Heather
2
by: DFS | last post by:
I inadvertently deleted all the items from the built-in Access97 Window menu: Tile Horizontally, Tile Vertically, Cascade, etc. Can I somehow get them back without reinstalling Access97 (or...
0
by: Elaine | last post by:
I have a truly curious problem with HtmlHelp and Sibling Mode in Visual C++ ..Net 2003 in an MFC app. Sibling mode allows the help viewer to display on top of the app, but if the app is clicked,...
10
by: tmaster | last post by:
When I try to dynamically add a second sub menu item to this ContextMenu item, I get an error 'Specified argument was out of the range of valid values'. Private Sub mnuTopics_Show_Select(ByVal...
1
by: Dino Buljubasic | last post by:
Hi, My application has a menu with some of the menu items that have their own menu items. By default, VB will add a black right rectangle when a menu items has its own menu items. However,...
2
by: Ludwig | last post by:
My application has a main tool strip menu (File, Options, help,...). There are also a number of context menu's that popup. Some main menu items should also be available in some context menu's. ...
8
by: gs | last post by:
I was able to set tooltips on objects other than main menu. I would like to get the effect of tooltip or microhelp in the bottom status bar when the mouse is hovering over a submenu item. How do...
1
by: xpnctoc | last post by:
Here's the 30,000-ft. view: I wrapped an asp:Menu control in an ascx control. When I try to dynamically populate the menu in the ascx control, the items appear, but clicking on them fails to trigger...
2
by: MCM | last post by:
I'm working on a plotting control. The plotting control will have a context menu with basic commands for "scaling", "zooming", etc. Is there a way that, from the parent form, I can add more...
13
by: PetterL | last post by:
I writing a program where I read menu items from a file. But I have problem when I click an menu item i want it to mark that one as checked but I cant access the menu object of that item to see...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.