in reply to Win32::GUI RadioButton
You can use the -group option when creating the control. As mentioned by BrowserUk above, you specify it on the first control you want in the group and all controls created after are in the same group until you create another control with the -group option. Here is an example:
#!perl use strict; use warnings; use feature qw(:5.12); use Win32::GUI qw(); use Win32::GUI::Constants qw(CW_USEDEFAULT); my $winMain = Win32::GUI::Window->new( -name => 'winMain', -text => 'Radio Buttons', -size => [320,240], -left => CW_USEDEFAULT, ); # These radio buttons are in one group my $rad1 = $winMain->AddRadioButton( -name => 'rad1', -text => 'rad1', -pos => [10,10], -group => 1, ); my $rad2 = $winMain->AddRadioButton( -name => 'rad2', -text => 'rad2', -pos => [10,30], ); # These radio buttons are in another group my $rad3 = $winMain->AddRadioButton( -name => 'rad3', -text => 'rad3', -pos => [10,50], -group => 1, ); my $rad4 = $winMain->AddRadioButton( -name => 'rad4', -text => 'rad4', -pos => [10,70], ); $winMain->Show(); Win32::GUI::Dialog();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Win32::GUI RadioButton
by petecm99 (Pilgrim) on Jan 26, 2011 at 12:51 UTC |