But I think there might be a bug on how the form stocks its values or how it passes it during an event.
The label object with the event “click” does not passthrough the current form value while button objects do.
Symptoms:
-if I click next it saves passes the correct current value.
-if I click Label it send the old value from before and not the current value.
For example, I have a $Datagridview object where I have a checkbox. By default, it is unchecked.
If I click my button object next it passes through the current value of that checkbox which is what I want and correct.
However, when clicking on a label with the event “click”. It does not pass the current checkbox value. It sends the old one from before.
To identify this scenario, I set up breakpoints in-between events and used the watcher and debug console to inspect the values of the forms.
- $LabelLateral_Click = {
- #When setting the breakpoint here the value is not the current $DataGridView
- if ($(Set-ValidData -FormValidation CustomizationsForm))
- {
- switch ($this.Text)
- {
- "Readiness" {
- if ($ReadinessChecksForm)
- {
- $CustomizationsForm.TopMost = $false
- $CustomizationsForm.Visible = $false
- $ReadinessChecksForm = Show-ReadinessChecksForm_psf
- }
- }
- "Computer Details" {
- if ($ComputerDetailsForm)
- {
- $CustomizationsForm.TopMost = $false
- $CustomizationsForm.Visible = $false
- $ComputerDetailsForm = Show-ComputerDetailsForm_psf
- }
- }
- "Credentials" {
- if ($ComputerCredentialsForm)
- {
- $CustomizationsForm.TopMost = $false
- $CustomizationsForm.Visible = $false
- $ComputerCredentialsForm = Show-ComputerCredentialsForm_psf
- }
- }
- "Summary"{
- $CustomizationsForm.TopMost = $false
- $CustomizationsForm.Visible = $false
- $SummaryForm = Show-SummaryForm_psf
- }
- }
- }
- }
- $ButtonNext_Click = {
- #When setting the breakpoint here the value is the current of $DataGridView
- if ($(Set-ValidData -FormValidation CustomizationsForm))
- {
- $CustomizationsForm.TopMost = $false
- $CustomizationsForm.Visible = $false
- $SummaryForm = Show-SummaryForm_psf
- }
- }
I appreciate fro any feedbacks.
Thank you in advance.