Click here to Skip to main content
14,240,610 members
Rate this:
Please Sign up or sign in to vote.
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.

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
Rate this:
Please Sign up or sign in to vote.

Solution 1

What have you tried so far?
Post some code here and maybe someone can help you find a solution.
   
Comments
himani_jha 1-Jul-10 0:52am
   
I have submitted the code
Rate this:
Please Sign up or sign in to vote.

Solution 2

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.
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100