working on a simple interface with psscriptpad and have been unable to figure out how to get the databindings to work in the gui.
any help would be massively appreciated!!
working on a simple interface with psscriptpad and have been unable to figure out how to get the databindings to work in the gui.
any help would be massively appreciated!!
so far i have been able to get the checkbox to enable the button when its checked but when i uncheck the checkbox it doesnt disable the button
$AcceptCheckbox_CheckedChanged = {
if ($CheckBox1.Checked) {
$DataCollectorButton.Enabled = $false}
Else {
$DataCollectorButton.Enabled = $true}
}
$AcceptCheckbox_CheckedStateChanged = {
if ($CheckBox1.Checked) {
$DataCollectorButton.Enabled = $false}
Else {
$DataCollectorButton.Enabled = $true}
}
Add-Type -AssemblyName System.Windows.Forms
. (Join-Path $PSScriptRoot ‘loader.designer.ps1’)
$Form1.ShowDialog()
going to put this here because i finally found my mistake and corrected it so if anyone needs a checkbox to enable/disable a button here it is.
$AboutMeButton_MouseClick = {
}
$Form1_Load = {
}
$AcceptCheckbox_CheckedChanged = {
if ($AcceptCheckBox.Checked) { $DataCollectorButton.Enabled = $true }
else { $DataCollectorButton.Enabled = $false }
if ($AcceptCheckBox.Checked) { $RepairToolButton.Enabled = $true }
else { $RepairToolButton.Enabled = $false }
}
Add-Type -AssemblyName System.Windows.Forms
. (Join-Path $PSScriptRoot ‘loader.designer.ps1’)
$Form1.ShowDialog()