[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 %_;