473,624 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MenuStrip in Windows Form (C#)

Atran
319 Contributor
Hello:
I have a MenuStrip in my form, so I add a ToolStripMenuIt em to the MenuStrip.
The ToolStripMenuIt em has a checkBox.
-------------------------------------------------------------
Now, The ToolStripMenuIt em is checked.
I want: When I click The ToolStripMenuIt em, The ToolStripMenuIt em be unchecked, and when I back again and click The ToolStripMenuIt em, The ToolStripMenuIt em be checked.
I try this code, but doesnt work:
Expand|Select|Wrap|Line Numbers
  1. private void ToolStripMenuItem_Click(object sender, EventArgs e)
  2.         {
  3.             if (ToolStripMenuItem.Checked.Equals(true) == true)
  4.             {
  5.                 ToolStripMenuItem.Checked.Equals(false);
  6.             }
  7.             if (ToolStripMenuItem.Checked.Equals(false) == true)
  8.             {
  9.                 ToolStripMenuItem.Checked.Equals(true);
  10.             }
  11.         }
  12.  
Thanks......... .......
Jun 12 '07 #1
3 8535
Plater
7,872 Recognized Expert Expert
There is a property you can set to have this done automatically CheckOnClick
Jun 12 '07 #2
TRScheel
638 Recognized Expert Contributor
On an aside, couldnt you just write:

Expand|Select|Wrap|Line Numbers
  1. ToolStripMenuItem.Checked = !ToolStripMenuItem.Checked;
Jun 12 '07 #3
Atran
319 Contributor
Thanks to you all............ ....
Jun 12 '07 #4

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

Similar topics

4
21663
by: John J. Hughes II | last post by:
Could someone explain how to merge the form menu with the mdi container window. The menu strip items on the form window merge but I either end up with a blank blue menu on the form or top list of items that don't do anything. MDI Container.IsMdiContainer = true MenuStrip.AllowMerge = true /// First menu items this.miFile.MergeAction = System.Windows.Forms.MergeAction.Insert;
0
1840
by: rellik | last post by:
Hi All, I've run into a problem with the MenuStrip control and any help would be greatly appreciated! The problem I've got is that when use a control derived from the MenuStrip class all MDI merge functionality breaks - each MDI child window is given it's own menu rather than the mdi parent. To repeat the problem just create a very simple dummy app that has standard
0
2017
by: academic | last post by:
I'm having a problem merging a ContextMenuStrip for a UserControl to the MenuStrip on the form containing the UserControl. I tried the following thinking that it is equivalent to cloning the ContextStrip menu Thanks for Any helpful suggestions?
0
2958
by: genojoe | last post by:
Included below are four methods and a Friend that can be inserted directly into a form that already contains Button1, Button2, and MenuStrip1. Button1 populates the MainMenu control, button2 populates the MenuStrip control. The MainMenu is from legacy 2003 and works fine. I want to upgrade to the MenuStrip but cannot find a way to duplicate legacy code. Shown below is my best effort. I am having two problems. #1: ToolStripMenuItem...
1
1979
by: genojoe | last post by:
I am converting from MainMenu to MenuStrip And I want to list the hierarchy of a clicked menu item. With the MainMenu, it was easy to do using the parent property of the MenuItem. With the ToolStripMenuItem, it no longer works. To better understand my need, please create a VS form and add a MenuStrip, button and two labels to it with the default names then add the code shown below to the form. What I need is code in the menuClick...
1
4039
by: Schwammkopf | last post by:
Hi ! I'm using Visual Studio 2005 Professional Edition and C#. I have a simple question: I want to add to my form, which is a scrollable control, a menustrip and statusstrip. The problem is that the menustrip is not fixed at top if i scroll down. A similar problem exists also for the statusstrip. If i open the program it is only visible if i scroll down.
3
2737
by: Gav | last post by:
I am using a MenuStrip on a form and adding a Panel to the same form in the program. When the Panel is added the top of the Panel is behind the MenuStrip, so the top of the Panel is hidden. How do I make the Panel I have added appear below the MenuStrip? Is it something to do with the MenuStrip, is it floating? Gav
0
5038
by: kyungdongkim | last post by:
Hi, I have a dynamically generated MenuStrip following this example: http://www.codeproject.com/useritems/Dynamic_MenuStrip.asp Basically the menu strip allows users to save and load reports. The Load menu is to list all the saved reports. I need to refresh the Load menu after a new report is saved. Any help is much appreciated! Code:
1
623
by: Tony Johansson | last post by:
Hello! I have a System.Windows.Forms.MenuStrip with some ToolStripMenuItem. One of these ToolStripMenuItem is called saveMemberToolStripMenuItem. This one is defined like this this.saveMemberToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); I have also a ContextMenuStrip which is connected to the Form. In the Form C-tor I have these statements
0
8170
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8619
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6108
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.