Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ITextInputPanel::PreferredInPlaceDirection property

Applies to: desktop apps only

Gets or sets the preferred direction of the in-place Input Panel relative to the text entry field.

This property is read/write.

Syntax

HRESULT put_PreferredInPlaceDirection(
  [in]           InPlaceDirection Direction
);

HRESULT get_PreferredInPlaceDirection(
  [out, retval]  InPlaceDirection *Direction
);

Property value

The preferred direction of the In-Place Input Panel relative to the text entry field.

Error codes

NameMeaning
S_OK

Success.

E_INVALIDARG

The parameter contains an invalid value.

E_FAIL

An unspecified error occurred.

Remarks

An application can specify whether the in-place Input Panel defaults to appearing above or below a text entry field. To do this the application can set the ITextInputPanel::PreferredInPlaceDirection Property to InPlaceDirection_Bottom or InPlaceDirection_Top. ITextInputPanel::PreferredInPlaceDirection Property is a preference because the in-place Input Panel overrides the preference set by the application when necessary to keep Input Panel on the screen. The system default is to position the in-place Input Panel below a text field when possible and otherwise to position it above. Setting the PreferredInPlaceDirection to InPlaceDirection_Auto restores the system default.

Examples

This C++ example creates an ITextInputPanel object, g_pTip, and attaches it to the window handle of an InkEdit control, IDC_EDIT3, by setting the ITextInputPanel::AttachedEditWindow Property property. It also sets, then gets the ITextInputPanel::PreferredInPlaceDirection Property.


if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}


Requirements

Minimum supported client

Windows XP Tablet PC Edition

Minimum supported server

None supported

Header

Peninputpanel.h (also requires Peninputpanel_i.c)

DLL

Tiptsf.dll

See also

ITextInputPanel Interface

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.