Question:
Is there a way to catch the <Tab> character / event in an MFC CEdit so that I can override the default tab-order behaviour? In other words: is there a way to programmatically register and unregister a <Tab> handler?
Context:
I am aware of MFC's tab-ordering mechanism in which you specify an order, at compile time, in which to tab through visible controls. What I want to do is subclass CEdit so that pressing <Tab> while in this CEdit cycles the adjacent label (read-only CEdit) through a pre-set list of strings, and once the list is finished, pressing <Tab> again moves focus out and lets MFC's default tab-ordering take over again.
My gut tells me this should be possible, but I can't find any useful documentation. If MFC has a way to dynamically register and unregister for <Tab> events (or arbitrary key events) then this would be really easy, but I haven't found it.
Summary
Basically, let's say I have 4 edit boxes e1, e2, e3, e4; and a list of 3 strings; str1, str2, str3 that go into a label somewhere else on the dialog. If we start with the cursor in e1, I want the tab order to go like this:
- e1
- e2
- e3
- e3, str1
- e3, str2
- e3, str3
- e4
Is this possible? Are there other ways of obtaining the same behaviour?
