ISPWManagedToolAddinUI.ProcessMnemonics Method
This method provides an implementation to handle tab events in the form. SharePoint Workspace does not have access to the tab order defined in the form and, therefore, may move the cursor to fields in an unexpected order. To resolve this problem, you can provide an implementation of this method to handle the user tab controls correctly.
Namespace: Microsoft.Office.SharePointWorkspace.AddIn
Assembly: Microsoft.Office.SharePointWorkspace.AddIn.Interface (in Microsoft.Office.SharePointWorkspace.AddIn.Interface.dll)
Syntax
'Declaration
Function ProcessMnemonics ( _
hWnd As IntPtr, _
msg As Integer, _
wparam As IntPtr, _
lparam As IntPtr _
) As Boolean
'Usage
Dim instance As ISPWManagedToolAddinUI
Dim hWnd As IntPtr
Dim msg As Integer
Dim wparam As IntPtr
Dim lparam As IntPtr
Dim returnValue As Boolean
returnValue = instance.ProcessMnemonics(hWnd, _
msg, wparam, lparam)
bool ProcessMnemonics(
IntPtr hWnd,
int msg,
IntPtr wparam,
IntPtr lparam
)
Parameters
- hWnd
Type: System.IntPtr
Provides the Message.Create hWnd parameter, which is the window handle that the message is for.
- msg
Type: System.Int32
Provides the Message.Create msg parameter, which is the message identifier.
- wparam
Type: System.IntPtr
Provides the Message.Create wparam parameter, which is a parameter field.
- lparam
Type: System.IntPtr
Provides the Message.Create lparam parameter, which is a parameter field.
Return Value
Type: System.Boolean
true indicates that the implementation has moved the cursor to the next field and that SharePoint Workspace should not move the cursor. false indicates that the implementation has not moved the cursor to the next field and that SharePoint Workspace should move the cursor to the next field.
Remarks
To handle the user tab controls correctly, provide the following implementation of the ProcessMnemonics method:
bool ISPWManagedToolAddinUI.ProcessMnemonics(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
{
Message message = Message.Create(hWnd, msg, wparam, lparam);
PreProcessControlState state = this.PreProcessControlMessage(ref message);
if (msg == 0x100 && (int)wparam == 0x09 && state == PreProcessControlState.MessageNotNeeded)
{
Control firstControl = GetNextControl(null, true);
if (firstControl != null)
{
firstControl.Select();
return true;
}
}
return state == PreProcessControlState.MessageProcessed;
}
See Also
Reference
ISPWManagedToolAddinUI Interface