PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WD55] [Events] WM SETFOCUS
[WD55] [Events] WM SETFOCUS
Débuté par Kropotkin, 26 juin 2001 21:37 - Aucune réponse
Posté le 26 juin 2001 - 21:37
Hi,

I try to create a small class to set the ..brushcolor (..couleurfond)
property for some controltypes, who will get the focus, in the complete
project

The problem is that it looks that on window opening,
the first control of a window, altough it got and have the focus,
the WM_SETFOCUS event is not trapped ?

Do I do something wrong ?
Are there any solutions ?

Thanks for any comment.

(For the complete class send an email to petervu@xs4all.nl)

Peter


<<< code example >>>

_______
Project Initialization :

liBColor is long int = Color file://iLightYellow
CBrushcolor is object CBColor(liBColor)

_____
Procedure cBColor::Constructor(BColor=0)

:liRGB = BColor
....
:iEvents[1]=Event(":BrushColorSet","*.*",0x0007) file://WM_SETFOCUS
:iEvents[2]=Event(":BrushColorReset","*.*",0x0008) file://WM_KILLFOCUS
_____

Procedure cBColor::BrushColorSet()

if count(_eve.name)>0 then
if :siControltype[:GetControltype(_eve.name)]=1 then
{_Eve.Name}..brushcolor=:liRGB
end
end
______

Procedure cBColor::BrushColorReset()

if count(_eve.name)>0 then
if :siControltype[:GetControltype(_eve.name)]=1 then
{_Eve.Name}..brushcolor=idefaultcolor
end
end
_____