开发者

How to open again the minimized pop up window

开发者 https://www.devze.com 2022-12-31 12:46 出处:网络
Here ther is one button. If we click that button 开发者_开发技巧pop up window will be opened.If i minimized that one and again i click that button means that minimized pop up window sholud be opened.

Here ther is one button. If we click that button 开发者_开发技巧pop up window will be opened.If i minimized that one and again i click that button means that minimized pop up window sholud be opened. Any idea ?


Assuming that the popup window is part of your assembly, just keep track of a reference to it when you create it on the first click and on the second click just change the WindowState of the reference, like:

frm.WindowState = FormWindowState.Normal

If the popup window is an external app you can get a handle to it via FindWindowEx and then call SetWindowPlacement. They're both Windows API methods that can be called via PInvoke. More information can be found here:

http://www.pinvoke.net/default.aspx/user32/setwindowplacement.html

0

精彩评论

暂无评论...
验证码 换一张
取 消