I'm slowly teaching myself PowerShell and I'm completely baffled by enums. To my understanding, they're just a collection of friendly names for what are really integer values. Okay, ... that's great ... but how do you get PowerShell to actually "see" them?
Example:
[System.Windows.Forms.Application]::EnableVisualStyles();
$form = new-object Windows.Forms.Form
$form.Text = "Image Viewer"
$form.Width = $img.Size.Width;
$form.Height = $img.Size.Height;
$pictureBox = new-object Windows.Forms.PictureBox
$pictureBox.Width = $img.Size.Width;
$pictureBox.Height = $img.Size.Height;
$pictureBox.SizeMode = PictureBoxSizeMode.StretchImage
This would be great if PowerShell had any clue what "PictrueBoxSizeMode.StretchImage" was. It's a numeric value -- I know that -- you know that -- how do I get PowerShell to know that?
Thanks in advance?
[System.Windows.Forms.PictureBoxSizeMode]::StretchImage$pictureBox.SizeMode = 'StretchImage'