I have a popup menu in my listview which i would like as disabled when the click is not on any row, I would like to know on what event of ListView or PopupMenu should i do this.
Thanks in Advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Handle the
OnPopupevent of the popup menu like this:Don’t try and use the mouse cursor in your logic because the popup menu may be invoked from the keyboard.
It turns out that you want to disable certain items on the menu dependent on the selection. You should use actions for this and then you can centralise control of UI properties. An action can be linked to a button, a popup menu item, a main menu item and so on. You don’t want to write code that enables and disables all of these separately—actions solve this problem.
Use the
OnUpdateevent for this.Or sometimes you want the same
OnUpdatefor many actions which you would code list this: