How to close TextInputPanel

后端 未结 1 523
深忆病人
深忆病人 2021-01-16 11:28

I am porting a WPF application to run on a Windows 8 tablet.

I want to make a TextInputPanel appear when a textbox gets focus and disappear when it looses focus.

1条回答
  •  走了就别回头了
    2021-01-16 12:32

    As I mentioned in the comments, TabTip immediately spawns 2 other processes then exits the calling process.

    Iterate through all open processes and close one called TabTip. This will close both processes.

    using System;
    using System.Diagnostics;
    using System.Windows.Forms;
    
    namespace VirtualKeyboard
    {
        public partial class Form1 : Form
        {
    
            public Form1()
            {
                InitializeComponent();
            }
    
            private void Open_Click(object sender, EventArgs e)
            {
                Process.Start(@"C:\Program Files\Common Files\microsoft shared\ink\tabtip.exe");
            }
    
            private void Close_Click(object sender, EventArgs e)
            {
                Process[] processlist = Process.GetProcesses();
    
                foreach(Process process in processlist)
                {
                    if (process.ProcessName == "TabTip")
                    {
                        process.Kill();
                        break;
                    }
                }
            }
    
        }
    }
    

    0 讨论(0)
提交回复
热议问题