Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

TabKeyIntercept

Defines the status of Tab key handling during cell editing.

C

BOOL WINAPI SftTree_GetTabKeyIntercept(HWND hwndCtl);
void WINAPI SftTree_SetTabKeyIntercept(HWND hwndCtl, BOOL fSet);
BOOL WINAPI SftTreeSplit_GetTabKeyIntercept(HWND hwndCtl);
void WINAPI SftTreeSplit_SetTabKeyIntercept(HWND hwndCtl, BOOL fSet);

C++

BOOL CSftTree::GetTabKeyIntercept() const;
void CSftTree::SetTabKeyIntercept(BOOL fSet = TRUE);
BOOL CSftTreeSplit::GetTabKeyIntercept() const;
void CSftTreeSplit::SetTabKeyIntercept(BOOL fSet = TRUE);

Parameters

hwndCtl

The window handle of the tree control.

fSet

Set to FALSE to allow an application to handle the Tab key for child windows attached to a tree control during cell editing, otherwise set to TRUE.

Returns

GetTabKeyIntercept returns FALSE if the Tab key can be handled by the application, otherwise TRUE is returned.

Comments

The GetTabKeyIntercept and SetTabKeyIntercept functions define the status of Tab key handling during cell editing.

This is an advanced function, which can be used to control the default implementation of the Tab key handling during cell editing.

By default, if the Tab key is pressed during cell editing and a child control has the input focus, the tree control will generate a SFTTREEN_VALIDATEEDIT notification. This behavior can be changed by using SetTabKeyIntercept(FALSE), so the tree control no longer generates the notification. It is up to the application or the child window to handle the Tab key and respond accordingly.

A child control may not receive the Tab control character, even if SetTabKeyIntercept(FALSE) is used. This is caused by the child control's response to the WM_GETDLGCODE message, which determines if Tab keys are forwarded to the child control. There are several articles relating to this subject in the Microsoft's Knowledge Base. Please see the appropriate Windows documentation for more information on this subject.

As an alternative, the SetKeyHandling function can be used to define keystrokes intercepted during cell editing. Using SetKeyHandling may be easier than subclassing child windows and using TakKeyIntercept.

See Also C/C++ API | Categories | Notifications