#requires -Version 3 #------------------------------------------------------------------------ # Source File Information (DO NOT MODIFY) # Source ID: e7986627-e6b1-4f85-af4d-1edcef8b8d12 # Source File: Demo-FlowLayout.psf #------------------------------------------------------------------------ #region File Recovery Data (DO NOT MODIFY) <#RecoveryData: ugQAAB+LCAAAAAAABABllMeuq1gQReeW/A9Xb4r6EUyydPtKmBxNMHFGONhkTIavb+v1pKWu0Vap arb2+rZB2i1g2Ll4ir8+YSy69u9fl9/or5/z6evr+z4Uz6KNa6GogRE34IcDTfeXUHerFu/dPP3u x/wb/t/Vn1+hG5qfCqNUNDrS6sYzDHvnWObfuTGc56HogpWMm0cQAmNcHbpQV5nsJMQ2i2LVO7HF 9ToIe1UtGzmVcuol4XCFjfPphsovhCuHRimsrnKIDc7JttVNOm8yaNVpKQ/hvOAqU0KeYMD4tvSy 1/ZmxzVtcrNy2hpVhPgRsFN7OZ/elTZboacXNVUOtwRWGytMbaQnmUaeVJW2xtjeifrCgTnKmcRO r9OELU6sJVOSIOyEUL7cMULTzgZ5Pk2VT9/AHVrL16DKnl91me8WoX+vo51134tOswJBCw63q1Of lXxoWDzR3XCOkldjbfCZiuQsMawsMZ3zqYvcUotTQAScwry47TqwstcFYRaYXZk/bmQNv6Tnus2C N1/99P2sNKbidAuMPRRacYuQhTXXRuqnR3A+WWyXo4KzAG9NfFyAd6cIHnjwFKm+YECY7DeXVS1I K6jt1RVHJbyvvrkJbAg21yUDSW+ceMstc3RE/HzSEfpW8NrICSFJVKEAZcxiXsRaE/HqHcEevZV5 i4LHRCwWPooKD0lQeeCUuNzxtA0odCkr7GAd6QPJ+fSBhBSAjPhUjUl3pauuDFPpb+Tp9Gj8TF46 1EP8QT6jRXXM0a505FoaTiC16uDaOHX37r0YIJJ5qebofHJxcgtEpSTnlaRaYK7JIbS29GCDLOTT 1rVN9dEg2ZXD+O65e9gKXEs7+NtDbULA9c+2nYNZzF62VBfn04sx36ZF1zXUrfDgtp2ZkcdliaGo oDFJlBE0ed0ULm9c51MQFgqGwzSVDXOcdo44EHRXvdPcXPJlQjmfPNfW+HnZtoRdq6tWPWoYtlAU QBqR7TBOysEeWFHkE0Ey87Aga/IQGp7aDMrdIaToAeN4MVAvWsxE9HwqTSdkZ04yCeJp9tSHvoS4 lHsP63ybv6j9PQtlZxCFpF9aZeBSBcZdB6SNmGTtdoTbAXYtj9PL1pjlh967ur0DTztSDIy00ENo TV+LtRZmfgqnTuInAacVcu2RABKUVup9QLChHQ6ZD887IYEEGJ5kkUp++dCr8pOaDRNhywtty2Yd kUYBD9WRvNsDTc3GmA/41j8Vl20s3mKYb/iPNP7ogxlH0CR1AcYv+LP5hv/rqp9/AMVciHW6BAAA#> #endregion <# .NOTES -------------------------------------------------------------------------------- Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2020 v5.7.172 Generated on: 04-2020-24 5:20 AM Generated by: James Vierra Organization: DSS -------------------------------------------------------------------------------- .DESCRIPTION GUI script generated by PowerShell Studio 2020 #> #---------------------------------------------- #region Application Functions #---------------------------------------------- #endregion Application Functions #---------------------------------------------- # Generated Form Function #---------------------------------------------- function Show-Demo-FlowLayout_psf { #---------------------------------------------- #region Import the Assemblies #---------------------------------------------- [void][reflection.assembly]::Load('System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') [void][reflection.assembly]::Load('System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') #endregion Import Assemblies #---------------------------------------------- #region Generated Form Objects #---------------------------------------------- [System.Windows.Forms.Application]::EnableVisualStyles() $form1 = New-Object 'System.Windows.Forms.Form' $textboxN = New-Object 'System.Windows.Forms.TextBox' $buttonGetTextboxN = New-Object 'System.Windows.Forms.Button' $buttonReizeToBoxWidth = New-Object 'System.Windows.Forms.Button' $buttonAdd10TextBoxes = New-Object 'System.Windows.Forms.Button' $flowlayoutpanel1 = New-Object 'System.Windows.Forms.FlowLayoutPanel' $buttonOK = New-Object 'System.Windows.Forms.Button' $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' #endregion Generated Form Objects #---------------------------------------------- # User Generated Script #---------------------------------------------- $form1_Load={ } $buttonAdd10TextBoxes_Click={ $count = $flowlayoutpanel1.Controls.Count for($i = $count;$i -lt $count+10; $i++){ $tb = [System.Windows.Forms.Textbox]::new() $tb.Text = 'Textbox {0:D3}' -f ($i+1) $tb.Name = 'Textbox{0:D3}' -f ($i+1) $flowlayoutpanel1.Controls.Add($tb) } } $buttonReizeToBoxWidth_Click={ $flowlayoutpanel1.Width = $flowlayoutpanel1.Controls[0].Width + 25 } $buttonGetTextboxN_Click={ $tbname = 'Textbox{0:D3}' -f [int]$textboxN.Text $text = $flowlayoutpanel1.Controls[$tbname].Text [System.Windows.Forms.MessageBox]::Show($text) } # --End User Generated Script-- #---------------------------------------------- #region Generated Events #---------------------------------------------- $Form_StateCorrection_Load= { #Correct the initial state of the form to prevent the .Net maximized form issue $form1.WindowState = $InitialFormWindowState } $Form_Cleanup_FormClosed= { #Remove all event handlers from the controls try { $buttonGetTextboxN.remove_Click($buttonGetTextboxN_Click) $buttonReizeToBoxWidth.remove_Click($buttonReizeToBoxWidth_Click) $buttonAdd10TextBoxes.remove_Click($buttonAdd10TextBoxes_Click) $form1.remove_Load($form1_Load) $form1.remove_Load($Form_StateCorrection_Load) $form1.remove_FormClosed($Form_Cleanup_FormClosed) } catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } } #endregion Generated Events #---------------------------------------------- #region Generated Form Code #---------------------------------------------- $form1.SuspendLayout() # # form1 # $form1.Controls.Add($textboxN) $form1.Controls.Add($buttonGetTextboxN) $form1.Controls.Add($buttonReizeToBoxWidth) $form1.Controls.Add($buttonAdd10TextBoxes) $form1.Controls.Add($flowlayoutpanel1) $form1.Controls.Add($buttonOK) $form1.AcceptButton = $buttonOK $form1.AutoScaleDimensions = '6, 13' $form1.AutoScaleMode = 'Font' $form1.AutoScroll = $True $form1.ClientSize = '284, 323' $form1.FormBorderStyle = 'FixedDialog' $form1.MaximizeBox = $False $form1.MinimizeBox = $False $form1.Name = 'form1' $form1.StartPosition = 'CenterScreen' $form1.Text = 'Form' $form1.add_Load($form1_Load) # # textboxN # $textboxN.Location = '148, 256' $textboxN.Name = 'textboxN' $textboxN.Size = '44, 20' $textboxN.TabIndex = 3 $textboxN.Text = '5' # # buttonGetTextboxN # $buttonGetTextboxN.Location = '12, 256' $buttonGetTextboxN.Name = 'buttonGetTextboxN' $buttonGetTextboxN.Size = '130, 23' $buttonGetTextboxN.TabIndex = 0 $buttonGetTextboxN.Text = 'Get textbox n' $buttonGetTextboxN.UseCompatibleTextRendering = $True $buttonGetTextboxN.UseVisualStyleBackColor = $True $buttonGetTextboxN.add_Click($buttonGetTextboxN_Click) # # buttonReizeToBoxWidth # $buttonReizeToBoxWidth.Location = '148, 227' $buttonReizeToBoxWidth.Name = 'buttonReizeToBoxWidth' $buttonReizeToBoxWidth.Size = '124, 23' $buttonReizeToBoxWidth.TabIndex = 2 $buttonReizeToBoxWidth.Text = 'Reize to box width' $buttonReizeToBoxWidth.UseCompatibleTextRendering = $True $buttonReizeToBoxWidth.UseVisualStyleBackColor = $True $buttonReizeToBoxWidth.add_Click($buttonReizeToBoxWidth_Click) # # buttonAdd10TextBoxes # $buttonAdd10TextBoxes.Location = '12, 227' $buttonAdd10TextBoxes.Name = 'buttonAdd10TextBoxes' $buttonAdd10TextBoxes.Size = '130, 23' $buttonAdd10TextBoxes.TabIndex = 0 $buttonAdd10TextBoxes.Text = 'Add 10 TextBoxes' $buttonAdd10TextBoxes.UseCompatibleTextRendering = $True $buttonAdd10TextBoxes.UseVisualStyleBackColor = $True $buttonAdd10TextBoxes.add_Click($buttonAdd10TextBoxes_Click) # # flowlayoutpanel1 # $flowlayoutpanel1.AutoScroll = $True $flowlayoutpanel1.BackColor = 'PeachPuff' $flowlayoutpanel1.BorderStyle = 'FixedSingle' $flowlayoutpanel1.Location = '12, 12' $flowlayoutpanel1.Name = 'flowlayoutpanel1' $flowlayoutpanel1.Size = '260, 209' $flowlayoutpanel1.TabIndex = 1 # # buttonOK # $buttonOK.Anchor = 'Bottom, Right' $buttonOK.DialogResult = 'OK' $buttonOK.Location = '197, 288' $buttonOK.Name = 'buttonOK' $buttonOK.Size = '75, 23' $buttonOK.TabIndex = 0 $buttonOK.Text = '&OK' $buttonOK.UseCompatibleTextRendering = $True $buttonOK.UseVisualStyleBackColor = $True $form1.ResumeLayout() #endregion Generated Form Code #---------------------------------------------- #Save the initial state of the form $InitialFormWindowState = $form1.WindowState #Init the OnLoad event to correct the initial state of the form $form1.add_Load($Form_StateCorrection_Load) #Clean up the control events $form1.add_FormClosed($Form_Cleanup_FormClosed) #Show the Form return $form1.ShowDialog() } #End Function #Call the form Show-Demo-FlowLayout_psf | Out-Null