Marynella,
Once you add a checkbox, you can use the Show() and Hide() methods to... well, hide and show it. Here is some sample code to demonstrate:
use strict;
use Win32::GUI;
my $Window = new Win32::GUI::Window(
-name => "Window",
-left => 100,
-top => 100,
-width => 150,
-height => 150,
-title => "checkbox test",
);
$Window->AddCheckbox(
-name => 'mycheckbox',
-left => 10,
-top => 10,
-height => 15,
-width => 15,
);
$Window->AddButton(
-text => 'Hide checkbox',
-left => 10,
-top => 35,
-height => 30,
-width => 100,
-name => 'btnHide',
);
$Window->AddButton(
-text => 'Show checkbox',
-left => 10,
-top => 75,
-height => 30,
-width => 100,
-name => 'btnShow',
);
$Window->Show();
Win32::GUI::Dialog();
sub Window_Terminate {
return -1;
}
sub btnShow_Click {
$Window->mycheckbox->Show();
}
sub btnHide_Click {
$Window->mycheckbox->Hide();
}
Update:
If you really want to *remove* a checkbox or combobox, something like this might work:
Win32::GUI::DestroyWindow($Window->{mycheckbox}{-handle});
delete $Window->{mycheckbox}; #use hashref syntax instead of autoload
+ed methods
|