Powershell : Problem with multiple textbox
Posted: Thu Apr 23, 2020 4:19 am
Hello,
I’m coming for help. For several days I have been stuck on my problem. I work with SAPIUEN Powershell Studio 2018 software.
I would like according to a variable to create the equivalent number of textbox.
(region createtextbox)
Then I only want the first textbox to be activated. the next can only be if the previous one has at least 5 characters. and when all my textboxes are filled, then I have a button that appears.
(region WRITETEXTBOX)
The first point is good, I can’t get there on the second and especially how I can select this or that textbox value?
Thank you in advance for your assistance.
My program :
I’m coming for help. For several days I have been stuck on my problem. I work with SAPIUEN Powershell Studio 2018 software.
I would like according to a variable to create the equivalent number of textbox.
(region createtextbox)
Then I only want the first textbox to be activated. the next can only be if the previous one has at least 5 characters. and when all my textboxes are filled, then I have a button that appears.
(region WRITETEXTBOX)
The first point is good, I can’t get there on the second and especially how I can select this or that textbox value?
Thank you in advance for your assistance.
My program :
- #region createtextbox
- $u = 1
- $u1 = 30
- $nbuser = 20
- Do
- {
- #$textboxuser = $textboxuser+$u
- $textboxuser = New-Object System.Windows.Forms.TextBox;
- $textboxuser.Location = New-Object System.Drawing.Size(16, $u1);
- $textboxuser.Name = 'textboxuser' + $u;
- $textboxuser.Text = $textboxuser.name;
- $textboxuser.Size = New-Object System.Drawing.Size (200, 20);
- $textboxuser.Enabled = $false;
- $u++
- $u1 = $u1 + 30
- $gbUSER.Controls.Add($textboxuser);
- }while ($u -le $nbuser)
- #endregion createtextbox
- #region WRITETEXTBOX
- $u = 1
- $textboxuser_TextChanged = {
- $u++
- $textboxuser = '$textboxuser'+$u
- $textboxuser.Enabled = $true
- }
- #endregion WRITETEXTBOX