Sorry, about the lack of information in my original post.  I just assumed, this being a perl-win32 group that Win32::GUI was a given.  I'll try to be more specific in the future.
 
I tried $control->Enable(0) but the control still gets greyed out.  I'm using activestate perl 5.8.7 and Win32::GUI 1.03 on win xp.  Here's a brief example:
 
#!c:\perl58\bin\wperl.exe -W
use strict;
use Win32::GUI;
use Win32::API;

our $mainform = Win32::GUI::Window->new(
                                          -name=>'main',
                                          -text=>'main',
                                          -width=>800,-height=>600,
                                        ) or die "window creation failed: $!\n";

our $test = $mainform->AddTextfield(
                                    -name=>'test',
                                    -text=>'test',
                                    -left=>200,-top=>200,
                                    -width=>100,-height=>20,
                                   );
$test->Enable(0);
$mainform->Show();
Win32::GUI::Dialog;

I also tried to set the onClick event to an empty sub which didn't work either
 
our $test = $mainform->AddTextfield(
                                    -name=>'test',
                                    -text=>'test',
                                    -left=>200,-top=>200,
                                    -width=>100,-height=>20,
                                    ->                                   );
 
On 12/18/05, Robert May <[EMAIL PROTECTED]> wrote:
Lynn. Rickards wrote:
> Chris Rogers wrote:
>
>> I'm looking for a way to disable a control (widget) without changing
>> it's appearance.  I would like to be able to do this for any type of
>> control.  Any help would be greatly appreciated.
>>
>> Thanks,
>> Chris
>>
> Tk? Win32? Either way, what comes to mind instead of disabling,
> is configuring/binding to an empty sub.

For Win32::GUI use
  $control->Enable(0);

Regards,
Rob.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to