Click here to Skip to main content
15,884,023 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my application I have a context menu in which there is menu Item Lock Control. I have a Boolean variable IsLock which keep track of wheather to lock controls or not.
I want that when I click on Lock Control of context menu,its text change to Unlock Control. and also want to change cusror to arrow with a lock.

C#
private void vlockControl_Click(object sender, EventArgs e)
    {
        if (IsLock)
        {
        }
        else
        {

        }
    }



On click event of lock control what to do I dont know. plz give ur answer with code. Here context menu's name is vContextMenu. and vlockControl is one menu item.
Posted
Updated 30-Jun-10 18:52pm
v2

What have you tried so far?
Post some code here and maybe someone can help you find a solution.
 
Share this answer
 
Comments
himani_jha 1-Jul-10 0:52am    
I have submitted the code
That's really a pretty basic thing to do.

You should know how to hook the event of the Lock Control button. If you don't, then you need to start at the very beginning.

So, hook the Lock Control button click and change it's Text property.

Getting the cursor, though, you'll have to create your own cursor file and embed it as a resource and then use it.
 
Share this answer
 
Comments
himani_jha 1-Jul-10 0:54am    
I know how to hook the event of lock control. but I dont know how to change text of that menu item. also I dont know how to create custom cursor plz help...
William Winner 1-Jul-10 13:03pm    
Like I said, that's a basic thing...that menu item has a Text property. Change it. If you don't know what any of that means, then you need to buy a beginner's programming book.

Creating a custom cursor is something you'll just have to google it.

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