![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Windows Forms focus question I'm playing around with .NET forms and such (no experience with them) and I'm trying to pop open a dialog box in front of my current app instead of behind it (this is on XP SP2), From the .Net Class Library on TechNet it looks like I need to include an IWin32Window object that references the app I want the window in front of. My code is: [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [Windows.Forms.MessageBox]::Show([Windows.Forms.IWin32Window]::Handle,"Proceed?","Question", [Windows.Forms.MessageBoxButtons]::YesNo) I can do the same basic thing with some vbscript compiled into an exe, but I'd really like to figure out .Net, and using it with powershell is an excellent excuse. So what am I missing? Lawndart |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Windows Forms focus question > I'm playing around with .NET forms and such (no experience with them) > and I'm trying to pop open a dialog box in front of my current app > instead of behind it (this is on XP SP2), From the .Net Class Library > on TechNet it looks like I need to include an IWin32Window object that > references the app I want the window in front of. My code is: I tried this out too a few months ago, and posted here... I actually *think* there is an issue with XP here. See also: http://community.bartdesmet.net/blog...9/16/4429.aspx |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Windows Forms focus question There's definitely an issue with dialog boxes from PowerShell on XP. Its even mentioned as an issue in Bruce Payette's book -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "Marco Shaw" wrote: > > I'm playing around with .NET forms and such (no experience with them) > > and I'm trying to pop open a dialog box in front of my current app > > instead of behind it (this is on XP SP2), From the .Net Class Library > > on TechNet it looks like I need to include an IWin32Window object that > > references the app I want the window in front of. My code is: > > I tried this out too a few months ago, and posted here... > > I actually *think* there is an issue with XP here. > > See also: > http://community.bartdesmet.net/blog...9/16/4429.aspx > > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Windows Forms focus question Ah, well, glad it's not just me ![]() This page: http://mow001.blogspot.com/2006/10/p...ction-gui.html has a handy example of a cheat to make it focus properly. Lawndart |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Windows Forms without ShowDialog? | PowerShell | |||
| simulate continuous forms & subforms in a windows forms application | .NET General | |||
| Windows Forms Editor | PowerShell | |||
| Error with Windows.forms.form | PowerShell | |||