的Windows Mobile 6 - 禁用自动完成的WinForms文本框 [英] Windows Mobile 6 - Disable AutoComplete on WinForms TextBoxes
问题描述
我想提出的是Windows Mobile 6的应用程序,在这里我需要在我有我的窗体上的文本框自动完成禁用。信息被扫描到他们,因此我需要禁用自动完成/自动提示功能。我能做到这一点编程或做我需要操纵注册表项? (这不是一个商业应用。)
I am making a windows mobile 6 app, where I need to disable autocomplete on the textboxes that I have on my form. Information is being scanned into them, therefore I need to disable the autocomplete/autosuggest feature. Can I do this programmatically or do I need to manipulate registry keys? (This is not a commercial application.)
推荐答案
使用这个类,它会在的PInvoke方法SHSetInputContext和禁用\\启用了该控件的事件悬停。只需通过控制手柄。
Use this class, it will pinvoke the SHSetInputContext method and disable\enable the hover over events for the controls. Simply pass the controls Handle.
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);
}
}
例如:
InputContext.SetAutoSuggestion(txtBoxOne.Handle, false);
这篇关于的Windows Mobile 6 - 禁用自动完成的WinForms文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!