Change SLE Resouce settings realtime

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Change SLE Resouce settings realtime

Post by robert »

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
XSharp Development Team
The Netherlands
robert@xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Change SLE Resouce settings realtime

Post by Karl-Heinz »

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.

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 	
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
User avatar
Alf
Posts: 54
Joined: Wed Dec 30, 2020 10:04 am

Change SLE Resouce settings realtime

Post by Alf »

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
Post Reply