[system.windows.forms.messagebox]::show("test","marco") works fine, but then
how do I add "messageboxbuttons.okcancel" (from what it seems to look like
in C#).
Marco
Oh, and how would I actually get it to open "on screen"? I just seems to
open minimized for me...
I'll keep playing...
Use [System.Windows.Forms.MessageBoxButtons]::OKCancel
In PowerShell :: seems gets used in place of . in C# when calling .NET
stuff.
Rob Kenny
> how do I add "messageboxbuttons.okcancel"
Live Search
http://search.live.com/results.aspx?q=%2Bmessageboxbuttons+%2BPowerShell
"Rob Kenny" <r...@otherniceman.net> wrote in message
news:uq4waULF...@TK2MSFTNGP06.phx.gbl...
you can find out by doing this :
PoSH>[system.windows.forms.messagebox] | Get-Member -static
TypeName: System.Windows.Forms.MessageBox
Name MemberType Definition
---- ---------- ----------
Equals Method static System.Boolean Equals(Object objA, Object
objB)
ReferenceEquals Method static System.Boolean ReferenceEquals(Object
objA, Object objB)
Show Method static System.Windows.Forms.DialogResult
Show(String text, String caption, MessageBoxButt...
for a comple list (many overloads) do this :
PoSH>[system.windows.forms.messagebox] | Get-Member -static | Format-List
TypeName : System.Windows.Forms.MessageBox
Name : Show
MemberType : Method
Definition : static System.Windows.Forms.DialogResult Show(String text,
String caption, MessageBoxButtons buttons, Mess
ageBoxIcon icon, MessageBoxDefaultButton defaultButton,
MessageBoxOptions options, Boolean displayHelpButt
on), static System.Windows.Forms.DialogResult Show(String text,
String caption, MessageBoxButtons buttons,
MessageBoxIcon icon, MessageBoxDefaultButton defaultButton,
MessageBoxOptions options, String helpFilePat
h), static System.Windows.Forms.DialogResult Show(IWin32Window
owner, String text, String caption, Message
BoxButtons buttons, MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
String helpFilePath), static System.Windows.Forms.DialogResult
Show(String text, String caption, MessageB
oxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton
defaultButton, MessageBoxOptions options,
String helpFilePath, String keyword), static
System.Windows.Forms.DialogResult Show(IWin32Window owner, St
ring text, String caption, MessageBoxButtons buttons,
MessageBoxIcon icon, MessageBoxDefaultButton default
Button, MessageBoxOptions options, String helpFilePath, String
keyword), static System.Windows.Forms.Dialo
gResult Show(String text, String caption, MessageBoxButtons
buttons, MessageBoxIcon icon, MessageBoxDefaul
tButton defaultButton, MessageBoxOptions options, String
helpFilePath, HelpNavigator navigator), static Sy
stem.Windows.Forms.DialogResult Show(IWin32Window owner, String
text, String caption, MessageBoxButtons bu
ttons, MessageBoxIcon icon, MessageBoxDefaultButton
defaultButton, MessageBoxOptions options, String helpF
ilePath, HelpNavigator navigator), static
System.Windows.Forms.DialogResult Show(String text, String capti
on, MessageBoxButtons buttons, MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton, MessageBoxOptio
ns options, String helpFilePath, HelpNavigator navigator,
Object param), static System.Windows.Forms.Dialo
gResult Show(IWin32Window owner, String text, String caption,
MessageBoxButtons buttons, MessageBoxIcon ic
on, MessageBoxDefaultButton defaultButton, MessageBoxOptions
options, String helpFilePath, HelpNavigator n
avigator, Object param), static
System.Windows.Forms.DialogResult Show(String text, String caption, Messag
eBoxButtons buttons, MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton, MessageBoxOptions options
), static System.Windows.Forms.DialogResult Show(String text,
String caption, MessageBoxButtons buttons, M
essageBoxIcon icon, MessageBoxDefaultButton defaultButton),
static System.Windows.Forms.DialogResult Show(
String text, String caption, MessageBoxButtons buttons,
MessageBoxIcon icon), static System.Windows.Forms.
DialogResult Show(String text, String caption,
MessageBoxButtons buttons), static System.Windows.Forms.Dia
logResult Show(String text, String caption), static
System.Windows.Forms.DialogResult Show(String text), s
tatic System.Windows.Forms.DialogResult Show(IWin32Window
owner, String text, String caption, MessageBoxBu
ttons buttons, MessageBoxIcon icon, MessageBoxDefaultButton
defaultButton, MessageBoxOptions options), sta
tic System.Windows.Forms.DialogResult Show(IWin32Window owner,
String text, String caption, MessageBoxButt
ons buttons, MessageBoxIcon icon, MessageBoxDefaultButton
defaultButton), static System.Windows.Forms.Dial
ogResult Show(IWin32Window owner, String text, String caption,
MessageBoxButtons buttons, MessageBoxIcon i
con), static System.Windows.Forms.DialogResult
Show(IWin32Window owner, String text, String caption, Messa
geBoxButtons buttons), static System.Windows.Forms.DialogResult
Show(IWin32Window owner, String text, Stri
ng caption), static System.Windows.Forms.DialogResult
Show(IWin32Window owner, String text)
PS playing with the WIndow owner and a form might also a way to handle focus
problem
Greetings /\/\o\/\/
http://www.microsoft.com/technet/scriptcenter/topics/winpsh/convert/inputbox.mspx
Greetings /\/\o\/\/
----- Original Message -----
From: "Marco Shaw" <ma...@Znbnet.nb.ca>
Newsgroups: microsoft.public.windows.powershell
Sent: Thursday, November 30, 2006 8:14 PM
Subject: Re: Using [system.windows.forms.messagebox]::show()
>> [system.windows.forms.messagebox]::show("test","marco") works fine, but
>> then
>
> Oh, and how would I actually get it to open "on screen"? I just seems to
> open minimized for me...
>
> I'll keep playing...
>
"Marco Shaw" <ma...@Znbnet.nb.ca> wrote in message
news:Ok$mf3KFH...@TK2MSFTNGP06.phx.gbl...
for example :
In this example I use a button (hidden as size is 1,1 change to 20,20 for
example to see the button and to test) and set it as default :
also you can see a trick to get the form in focus
http://mow001.blogspot.com/2006/10/powershell-calendar-function-gui.html
and if you need to add a lot of buttons ;-)
http://mow001.blogspot.com/2005/11/msh-minesweeper-gui-game.html
another example that I did translate from a HTA scripting example .
http://mow001.blogspot.com/2006/02/msh-concentration-scripting-games-part.html
and more
Greetings /\/\o\/\/
----- Original Message -----
From: "Marco Shaw" <ma...@Znbnet.nb.ca>
Newsgroups: microsoft.public.windows.powershell
Gr /\/\o\/\/
[system.windows.forms.messagebox]::show("hello","there","okcancel")
-bruce
--
Bruce Payette [MSFT]
Windows PowerShell Technical Lead
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit the Windows PowerShell Team blog at:
http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:
http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
My Book: http://manning.com/powershell
"Brandon Shell" <tshel...@gmail.com> wrote in message
news:%23GfYQpL...@TK2MSFTNGP06.phx.gbl...