Click here to Skip to main content
15,908,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating a TextEditor in windows C# app for learning purpose. In it I created a Menu item Language. It has various languages like c,c#,Java etc in menu's toolStripMenuItem. When application start It will checked with the 'Normal Text File' but I don't know how can I write code for :- when user change the selected menuItem like, 'Normal Text File' to 'C#' then I want to write code which give the interface to write with c# language, in status bar display the message like 'C# document File' and in Language Menu the C# checked and Normal Text File will be unchecked.
I think it could be CheckedChanged event of Language menu and using For loop to check which language is selected. I am trying this but I haven't any logic to do this in ForLoop. Pls give me advice or code. How can I do this?
Posted

1 solution

If I understand your question correctluy:

In your menu item click handler, you set the selected menu item Checked property, and change the status bar. In the event that you're trying to set the status bar at the time the app is started, simply call the menuitem's PerformClick method, and let the handler perform its function as it normally would.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900