How to detect/control the SoftInputPanel?

心已入冬 提交于 2019-12-11 08:31:00

问题


The SoftInputPanel, Soft Input Panel, or SIP is the on screen keyboard that displays on Windows Mobile devices.

How do I detect when someone clicks the SIP?

How do I programmatically enable/disable the SIP?


回答1:


Never mind.

Found a good article >> HERE <<.

Basically include using Microsoft.WindowsCE.Forms; and a P/Invoke:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsCE.Forms;
using System.Runtime.InteropServices;

namespace Test1 {

  public class Form1 : Form {

    [DllImport("coredll.dll")]
    public static extern bool SipShowIM(int dwFlag);

    InputPanel sip;

    public Form1() {
      InitializeComponent();
      sip = new InputPanel();
      sip.EnabledChanged += new EventHandler(SIP_EnabledChanged);
    }

    void SIP_EnabledChanged(object sender, EventArgs e) {
      if (sip.Enabled) {
        Console.WriteLine("Enabled");
      } else {
        Console.WriteLine("Disabled");
      }
    }

  }

}


来源:https://stackoverflow.com/questions/7970556/how-to-detect-control-the-softinputpanel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!