111,119
社区成员
发帖
与我相关
我的任务
分享
Public Class Form1
Private pr As Process
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
pr = Process.Start("osk.exe")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
pr.CloseMainWindow()
End Sub
End Class
using System.Diagnostics;
namespace Lee_test
{
public partial class Form1 : Form
{
private Process pr;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
pr = Process.Start("osk");
}
private void button2_Click(object sender, EventArgs e)
{
pr.CloseMainWindow();
//pr.Close();
//pr.Dispose();
}
}
}