Page 1 of 1

Need Help with PrimalForms CE Tab Control

Posted: Tue Sep 17, 2013 3:41 pm
by jshew
I am using PrimalForms CE 1.0.10.0 to generate a Windows Form for PowerShell 3.0. The "IssueDetails.ps1" panel includes a tab control, which gets an error at execution, even if I do not edit the generated code.

Code: Select all

[powershell].\IssueDetails.ps1
Cannot find drive. A drive with the name 'handler_TabPage' does not exist.
At L:\Desktop\Scripts\SQLServer\issue\IssueDetails.ps1:94 char:1
+ $handler_TabPage:_Click=
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (handler_TabPage:String) [], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound[/powershell]
Here is the generated code that references "handler_TabPage." Thanks in advance.

Code: Select all

.
.
.
$handler_TabPage:_Click= 
{
#TODO: Place custom script here

}
.
.
.
$form1.Controls.Add($tabControl1)
$tp_IssueInformation.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 4
$System_Drawing_Point.Y = 22
$tp_IssueInformation.Location = $System_Drawing_Point
$tp_IssueInformation.Name = "tp_IssueInformation"
$System_Windows_Forms_Padding = New-Object System.Windows.Forms.Padding
$System_Windows_Forms_Padding.All = 3
$System_Windows_Forms_Padding.Bottom = 3
$System_Windows_Forms_Padding.Left = 3
$System_Windows_Forms_Padding.Right = 3
$System_Windows_Forms_Padding.Top = 3
$tp_IssueInformation.Padding = $System_Windows_Forms_Padding
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 237
$System_Drawing_Size.Width = 842
$tp_IssueInformation.Size = $System_Drawing_Size
$tp_IssueInformation.TabIndex = 0
$tp_IssueInformation.Text = "Issue Information"
$tp_IssueInformation.UseVisualStyleBackColor = $True
$tp_IssueInformation.add_Click($handler_TabPage:_Click)
.
.
.

Re: Need Help with PrimalForms CE Tab Control

Posted: Tue Sep 17, 2013 3:53 pm
by davidc
FYI I moved this to the correct forum. We will look into the issue.

David

Re: Need Help with PrimalForms CE Tab Control

Posted: Tue Sep 17, 2013 4:09 pm
by davidc
This issue will be resolved in the next release of the tool. In the meantime remove the colon from the event name and it should work.

David

Re: Need Help with PrimalForms CE Tab Control

Posted: Tue Sep 17, 2013 5:10 pm
by jshew
Sorry, I tried that before posting. Commenting out the ":" (in one or both of two places) causes additional errors. However, I can comment out the following, and the panel displays without error:

Code: Select all

#$handler_TabPage:_Click= 
#{
##TODO: Place custom script here
#
#}

Re: Need Help with PrimalForms CE Tab Control

Posted: Thu Sep 19, 2013 8:54 am
by davidc
If you are not using the event, yes you can simply remove it.

David

Re: Need Help with PrimalForms CE Tab Control

Posted: Thu Sep 19, 2013 11:53 am
by jvierra
The code you posted is not exactly what was generated. It has been accidentally modified for sme reason.
See this:
$handler_TabPage:_Click=

Notice the ':' it should read:
$handler_TabPage_Click={...

One word with an underscore and no colon.