前台防止了一个button
你试试
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//设置了x坐标
int X = 100;
//调用window API
[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "MoveWindow")]
public static extern bool MoveWindow(System.IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process pf = System.Diagnostics.Process.Start(@"C:\Users\Tyler\Desktop\remind.txt");
pf.WaitForInputIdle();
MoveWindow(pf.MainWindowHandle, X, 10, 300, 200, true);
//第二次打开会向右移动10的距离
X += 10;
}
}
你试试
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//设置了x坐标
int X = 100;
//调用window API
[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "MoveWindow")]
public static extern bool MoveWindow(System.IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process pf = System.Diagnostics.Process.Start(@"C:\Users\Tyler\Desktop\remind.txt");
pf.WaitForInputIdle();
MoveWindow(pf.MainWindowHandle, X, 10, 300, 200, true);
//第二次打开会向右移动10的距离
X += 10;
}
}

