Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista Tutorial - Questions regarding system.windows.forms

Reply
 
Old 08-11-2007   #1 (permalink)
Luke
Guest


 
 

Questions regarding system.windows.forms

1. Is it possible to create a new window with system.windows.form while
allowing the script to continue operations? If so, how?

2. How do you create keyboard shortcuts from within a form (ex. have ctrl +
w close the window)?

My System SpecsSystem Spec
Old 08-11-2007   #2 (permalink)
Luke
Guest


 
 

RE: Questions regarding system.windows.forms

Another question: how do you create a window with thin title bars (ex.
http://www.mathcs.richmond.edu/~caud...mathscreen.jpg. Notice
the titlebar with the smaller "x" for the close button on the palette to the
right.)

"Luke" wrote:

> 1. Is it possible to create a new window with system.windows.form while
> allowing the script to continue operations? If so, how?
>
> 2. How do you create keyboard shortcuts from within a form (ex. have ctrl +
> w close the window)?

My System SpecsSystem Spec
Old 08-11-2007   #3 (permalink)
dreeschkind
Guest


 
 

RE: Questions regarding system.windows.forms

$form.FormBorderStyle = [Windows.Forms.FormBorderStyle]::SizableToolWindow

See:
[Windows.Forms.FormBorderStyle] | get-member -static

--
greetings
dreeschkind

"Luke" wrote:

> Another question: how do you create a window with thin title bars (ex.
> http://www.mathcs.richmond.edu/~caud...mathscreen.jpg. Notice
> the titlebar with the smaller "x" for the close button on the palette to the
> right.)
>
> "Luke" wrote:
>
> > 1. Is it possible to create a new window with system.windows.form while
> > allowing the script to continue operations? If so, how?
> >
> > 2. How do you create keyboard shortcuts from within a form (ex. have ctrl +
> > w close the window)?

My System SpecsSystem Spec
Old 08-11-2007   #4 (permalink)
Oisin Grehan
Guest


 
 

Re: Questions regarding system.windows.forms

On Aug 11, 4:32 pm, dreeschkind
<dreeschk...@discussions.microsoft.com> wrote:
> $form.FormBorderStyle = [Windows.Forms.FormBorderStyle]::SizableToolWindow
>
> See:
> [Windows.Forms.FormBorderStyle] | get-member -static
>
> --
> greetings
> dreeschkind
>
>
>
> "Luke" wrote:
> > Another question: how do you create a window with thin title bars (ex.
> >http://www.mathcs.richmond.edu/~caud...mathscreen.jpg. Notice
> > the titlebar with the smaller "x" for the close button on the palette to the
> > right.)

>
> > "Luke" wrote:

>
> > > 1. Is it possible to create a new window with system.windows.form while
> > > allowing the script to continue operations? If so, how?

>
> > > 2. How do you create keyboard shortcuts from within a form (ex. have ctrl +
> > > w close the window)?- Hide quoted text -

>
> - Show quoted text -


To answer 1:

in short, no. In the longer term, I'm thinking hard about how to solve
this one and have a few tricks up the old sleeve. The problem stems
from Windows Forms components requiring the same thread that created
them be the same on to service them. Each time you run a command in
posh, you end up with a different thread from a pool running your
pipeline. If you're on the wrong thread to manipulate the forms
object, the object's InvokeRequired property will return $true. This
means you are effectively screwed from this point onwards.

- Oisin


My System SpecsSystem Spec
Old 08-12-2007   #5 (permalink)
Duncan Smith
Guest


 
 

Re: Questions regarding system.windows.forms

On Aug 11, 10:06 pm, Oisin Grehan <ois...@gmail.com> wrote:
> On Aug 11, 4:32 pm, dreeschkind
>
>
>
> <dreeschk...@discussions.microsoft.com> wrote:
> > $form.FormBorderStyle = [Windows.Forms.FormBorderStyle]::SizableToolWindow

>
> > See:
> > [Windows.Forms.FormBorderStyle] | get-member -static

>
> > --
> > greetings
> > dreeschkind

>
> > "Luke" wrote:
> > > Another question: how do you create a window with thin title bars (ex.
> > >http://www.mathcs.richmond.edu/~caud...mathscreen.jpg. Notice
> > > the titlebar with the smaller "x" for the close button on the palette to the
> > > right.)

>
> > > "Luke" wrote:

>
> > > > 1. Is it possible to create a new window with system.windows.form while
> > > > allowing the script to continue operations? If so, how?

>
> > > > 2. How do you create keyboard shortcuts from within a form (ex. have ctrl +
> > > > w close the window)?- Hide quoted text -

>
> > - Show quoted text -

>
> To answer 1:
>
> in short, no. In the longer term, I'm thinking hard about how to solve
> this one and have a few tricks up the old sleeve. The problem stems
> from Windows Forms components requiring the same thread that created
> them be the same on to service them. Each time you run a command in
> posh, you end up with a different thread from a pool running your
> pipeline. If you're on the wrong thread to manipulate the forms
> object, the object's InvokeRequired property will return $true. This
> means you are effectively screwed from this point onwards.
>


That would be really nice. The other day I wrote little graphing
class to plot some simple parabolas, and had to create some text-box
controls to get the co-efficients and rate into the model. It
would've been easier to hook up the paint handler to a timer, and then
just manipulate the values at the posh prompt and see the results
directly (a little like smalltalk), but I figured it couldn't be done
in posh v1. Hopefully in a later version.

Regards,

Duncan

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
System.Windows.Forms.Form PowerShell
simulate continuous forms & subforms in a windows forms application .NET General
[system.Windows.Forms.MessageBox] PowerShell
Using [system.windows.forms.messagebox]::show() PowerShell
Data Fetching and system.windows.forms.form & .datagridview PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46