Designer issues - Incorrect Constructor

Issue #236 resolved
Joseph Sugamele created an issue

I just downloaded your software for trial. Not more than 10 minutes and I ran into my first issue, actually possibly 2. I am using visual studio 2019 and PowerShell Pro Tools 5.1.4

PS C:\Users\jsuga\source\repos\PowerShellProject1> $PSVersionTable

Name Value


PSVersion 5.1.18362.145
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.145
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

I am using the form designer, it seems that the references pane which i have now set 2 different times loses the System.Drawing. It winds up with an exclamation point and i need to remove and re-add. Big pain.

Even more so I add a label to the form, I change the Font Size, Bold, Underline and click save. I close the form and reopen and its saying System.Drawing.Font does not have a constructor. I see how the control is being added has the constructor incorrectly.

#
#label1
#
$label1.AutoSize = $true
$label1.Font = (New-Object -TypeName System.Drawing.Font -ArgumentList @([System.String]'Microsoft Sans Serif',[System.Single]12,([System.Drawing.FontStyle][System.Drawing.FontStyle]::Bold -bor [System.Drawing.FontStyle]::Underline),[System.Drawing.GraphicsUnit]::Point,([System.Byte][System.Byte]0)))
$label1.Location = (New-Object -TypeName System.Drawing.Point -ArgumentList @([System.Int32]12,[System.Int32]9))
$label1.Name = [System.String]'label1'
$label1.Size = (New-Object -TypeName System.Drawing.Size -ArgumentList @([System.Int32]57,[System.Int32]20))
$label1.TabIndex = [System.Int32]1
$label1.Text = [System.String]'label1'

Please let me know how to correct.

Comments (1)

  1. Adam Driscoll

    The issue with the Font constructor is now resolved. Please upgrade to the latest version of PoshTools. Thanks!

  2. Log in to comment