Windows Mobile 6 - Disabling AutoFill in WinForms Text Blocks

I am creating an application for Windows Mobile 6 where I need to disable the autocompletion of text fields that I have on my form. Information is scanned in them, so I need to disable the autocomplete / autostart function. Can I do this programmatically or do I need to manage registry keys? (This is not a commercial application.)

+3
source share
1 answer

Use this class, it will call the SHSetInputContext method and disable \ enable event guidance for controls. Just pass the control knob.

public static class InputContext
{
    private enum SHIC_FEATURE : uint
    {
        RESTOREDEFAULT = 0,
        AUTOCORRECT = 1,
        AUTOSUGGEST = 2,
        HAVETRAILER = 3,
        CLASS = 4
    }

    [DllImport("aygshell.dll")]
    private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE dwFeature, ref bool lpValue);

    public static void SetAutoSuggestion(IntPtr handle, bool enable)
    {
        SHSetInputContext(handle, SHIC_FEATURE.AUTOSUGGEST, ref enable);
        SHSetInputContext(handle, SHIC_FEATURE.AUTOCORRECT, ref enable);
    }
}

Example:

InputContext.SetAutoSuggestion(txtBoxOne.Handle, false);
+20
source

Source: https://habr.com/ru/post/1782477/


All Articles