#!c:\perl\wperl.exe -w use strict; use warnings; use Win32::GUI; my @page; my $font1 = Win32::GUI::Font->new( -name => "Arial", -size => 7 ); my $mainform = Win32::GUI::Window->new(-name=>'main',-text=>'test',-wi +dth=>200,-height=>200,-dialogui=>1); my $button1 = $mainform->AddButton(-name=>'button1',-top=>10,-left=>10 +,-text=>"button1",-ok=>1); my $text1 = $mainform->AddTextfield(-name=>'text1',-top=>10,-left=>100 +,-width=>50,-height=>20); my $button2 = $mainform->AddButton(-name=>'button2',-top=>40,-left=>10 +,-text=>"button2",-ok=>0); my $text2 = $mainform->AddTextfield(-name=>'text2',-top=>40,-left=>100 +,-width=>50,-height=>20); $mainform->Show(); Win32::GUI::Dialog(); exit; sub button1_Click { $mainform->MessageBox("You clicked button1. Changing the default +to button2.","button1"); $button1->Change(-ok=>0); #$button2->Change(-ok=>1,-addstyle=>BS_DEFPUSHBUTTON); $button1->Update(); $button2->Update(); $mainform->Update(); } sub button2_Click { Win32::GUI->MessageBox("You clicked button2. Changing the default + to button1.","button2"); $button2->Change(-ok=>0); #$button1->Change(-ok=>1,-addstyle=>BS_DEFPUSHBUTTON); $button1->Update(); $button2->Update(); $mainform->Update(); } sub main_Termintate { $mainform->Hide(); return -1; }
In reply to Re^2: How to change the default (ok) button in Win32::GUI
by ChrisR
in thread How to change the default (ok) button in Win32::GUI
by ChrisR
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |