/// <summary> 
        /// 显示/隐藏 软键盘 方法1      
        /// </summary>
        ///
        public static InputPanel _softKeyBoard = new InputPanel();

        public static void ShowHideSoftKeyBoard(Boolean isShow)
        {
            _softKeyBoard.Enabled = isShow;
        }

        /// <summary>
        /// 显示/隐藏 软键盘 方法2      
        /// </summary>
        /// <param name="isShow"></param>
        /// <returns></returns>
        ///
        [DllImport("coredll", EntryPoint = "SipShowIM")]
        private static extern bool SipShowIM(IntPtr SIP_STATUS);
        private static readonly IntPtr SIPF_OFF = (IntPtr)0x0;
        private static readonly IntPtr SIPF_ON = (IntPtr)0x1;

        public static bool SipShowIM(bool isShow)
        {
            return SipShowIM(isShow ? SIPF_ON : SIPF_OFF);
        }

 

例如在tbSend输入获取焦点时,显示软键盘,逝去焦点时隐私软键盘,方法

        private void tbSend_LostFocus(object sender, EventArgs e)
        {
            Common.SipShowIM(false);
        }

 

        private void tbSend_GotFocus(object sender, EventArgs e)
        {
            Common.SipShowIM(true);
        }

相关文章:

  • 2021-11-25
  • 2022-12-23
  • 2021-07-07
  • 2021-10-23
  • 2021-08-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-21
  • 2021-11-18
  • 2021-06-13
  • 2021-11-09
  • 2022-02-09
  • 2021-07-01
  • 2021-08-31
相关资源
相似解决方案