固定使用user32.dll中USER32的ShowWindow .NET
public partial class Form1 : Form
{
TheForm theForm;//empty form
public Form1()
{
InitializeComponent();
theForm = new TheForm();
}
internal const int SWP_SHOWWINDOW = 0x0040;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
internal static extern int ShowWindow(IntPtr hWnd, short cmdShow);
private void button1_Click(object sender, EventArgs e)//shows theForm when it wants to
{
ShowWindow(theForm.Handle, SWP_SHOWWINDOW);
}
private void button2_Click(object sender, EventArgs e)//shows theForm always
{
theForm.Show();
}
}
为什么叫USER32的ShowWindow后,大部分时间窗口 “停留在地狱” 第三方控件? 它捕获焦点丢失和丢弃,但不捕获鼠标事件,也不会自行绘制。
你想要做什么在上帝的绿色地球上? – siride
试图修复第三方组件... –