Handling Shift + Tab key combination
-
I have a dialog with with a list box and a Add button. When any item in the list box is selected then the Add button has to be enabled. I have a requirement where I would select the item in list box by pressing the Shift+Tab combination. (Shift+Tab combination would move the focus from control to control) How to know that Shift+Tab combination has occured.
-
I have a dialog with with a list box and a Add button. When any item in the list box is selected then the Add button has to be enabled. I have a requirement where I would select the item in list box by pressing the Shift+Tab combination. (Shift+Tab combination would move the focus from control to control) How to know that Shift+Tab combination has occured.
RegisterHotKey() Will work for you. http://msdn.microsoft.com/en-us/library/ms646309.aspx[^]
-
I have a dialog with with a list box and a Add button. When any item in the list box is selected then the Add button has to be enabled. I have a requirement where I would select the item in list box by pressing the Shift+Tab combination. (Shift+Tab combination would move the focus from control to control) How to know that Shift+Tab combination has occured.
Follow the second question in this article. http://msdn.microsoft.com/en-us/magazine/cc301431.aspx[^] and for exact code, click on figure 4 http://msdn.microsoft.com/en-us/magazine/bb984939.aspx[^]
-
I have a dialog with with a list box and a Add button. When any item in the list box is selected then the Add button has to be enabled. I have a requirement where I would select the item in list box by pressing the Shift+Tab combination. (Shift+Tab combination would move the focus from control to control) How to know that Shift+Tab combination has occured.
If the list box loses focus, you might disable the "Add" button and if the list box gains focus, you can enable the button. That sounds viable? This way you do not have to know if shift+tab was pressed or not.
It is a crappy thing, but it's life -^ Carlo Pallini