Thanks Aldo and Eric,

Eric, I used Aldo's solution and this worked for me.     Thanks to both of you
for your help.

Felice




"Aldo Calpini" <[EMAIL PROTECTED]> on 10/01/99 03:29:08 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:    (bcc: Felice Vittoria/Aut/Schneider)
Subject:  Re: [perl-win32-gui] change color





[EMAIL PROTECTED] wrote:
> Eric (and all),
>
> Actually, what I'm trying to do is change a label's (foreground) color if
a
> textbox is empty.    I notice that it doesn't change color on the
textbox's
> LostFocus.   I will notice the change once I lose the Window's focus and
then
> regain the focus.   (I did this by switching to another app and switching
back
> to this test app).

the control is simply not repainted; it is when you switch to another
window.
see solution below.

> Look at the following code.  Maybe I'm doing something wrong.
>
> ...
>
> sub txtOne_LostFocus {
>
>      if ($M->txtOne->Text eq "") {
>           $M->lblOne->Change( -foreground => [255,128,0]);
>      } else {
>           $M->lblOne->Change( -foreground => [0,0,0]);
>      }

    # add here:
    $M->lblOne->InvalidateRect(1);

> }

bye! :-)

__END__
# Aldo Calpini
%_ = split undef, join ' ', qw(fahokem
xritajbugne csuctawer jhdtlrnpqloevkshpr
); print map $_{$_}, sort keys %_;











Reply via email to