Alf,
SendMessage(self:oDCmLASTNAME:handle(), EM_SETREADONLY, 1,0 ) // to enable readonly
SendMessage(self:oDCmLASTNAME:handle(), EM_SETREADONLY, 0,0 ) // to make read/write
Robert
Change SLE Resouce settings realtime
Change SLE Resouce settings realtime
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
Change SLE Resouce settings realtime
Hi Alf,
to set the desired colors you might overwrite the ReadOnly assign. But it doesn´t make sence to create new objects each time the assign is triggered. So you should implement a global system where the required colors and brushes are created only once.
BTW: Are you the real Alf ?
Alf - "Can I use the microwave?"
Kate Tanner(Mom) - "Why?"
Alf - "Because the cat doesn't fit in the toaster."
SCNR
regards
Karl-Heinz
to set the desired colors you might overwrite the ReadOnly assign. But it doesn´t make sence to create new objects each time the assign is triggered. So you should implement a global system where the required colors and brushes are created only once.
Code: Select all
CLASS MySle INHERIT SingleLineEdit
ASSIGN ReadOnly(lNewValue) CLASS MySle
SUPER:ReadOnly := lNewValue
IF lNewValue
SELF:Background := Brush { Color { GetSysColor ( COLOR_BTNFACE ) } }
SELF:TextColor := Color { GetSysColor ( COLOR_WINDOWTEXT ) }
ELSE
SELF:Background := Brush { Color { GetSysColor ( COLOR_WINDOW ) } }
SELF:TextColor := Color { GetSysColor ( COLOR_WINDOWTEXT ) }
ENDIF
RETURN
Alf - "Can I use the microwave?"
Kate Tanner(Mom) - "Why?"
Alf - "Because the cat doesn't fit in the toaster."
SCNR
regards
Karl-Heinz
Change SLE Resouce settings realtime
Hi Karl-Heinz,
thanks. This works perfect.
<<<BTW: Are you the real Alf ?>>>
Yes, my name is really Alf. But I never put my cat in a microwave (only the barking dogs of my neighbors).
regards
Alf
thanks. This works perfect.
<<<BTW: Are you the real Alf ?>>>
Yes, my name is really Alf. But I never put my cat in a microwave (only the barking dogs of my neighbors).
regards
Alf