Change SLE Resouce settings realtime

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Change SLE Resouce settings realtime

Post by ic2 »

We capitalize our City field in an address database by setting Conversion to Uppercase. This is set in the resource, as follows:

CONTROL "City:", RELATIEVENSTER_MCITY, "Edit", ES_AUTOHSCROLL|ES_UPPERCASE|WS_TABSTOP|WS_CHILD|WS_BORDER, 150, 137, 156, 16, WS_EX_CLIENTEDGE

Now one client would like to be able to mix cases, so get rid of the upper case conversion. If it was a setting in the init (like oDCmCITY:Picture := "!!!!!!!!!!") I could override it using a setting in the Postinit.

Is it also possible to override "ES_UPPERCASE" resource?

I know I could set a picture instead depending on what the user has chosen but I was just wondering if there's another way, leaving the resource Conversion setting as it is.

Dick
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Change SLE Resouce settings realtime

Post by Chris »

Hi Dick,

Why don't you remove the ES_UPPERCASE from the resource (or, if the window is editor generated, set the "Conversion" property of the SLE in the WED to "No Conversion") and then set the picture as you said manually at runtime, so you have full control over this?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am

Change SLE Resouce settings realtime

Post by Karl-Heinz »

Is it also possible to override "ES_UPPERCASE" resource?
Hi Dick,

yes, the style ES_UPPERCASE can be added or removed at runtime.

Code: Select all

<oSle>:SetStyle ( ES_UPPERCASE , <lSet> )
Regards
Karl-Heinz
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Change SLE Resouce settings realtime

Post by Chris »

Karl-Heinz wrote:
Is it also possible to override "ES_UPPERCASE" resource?
Hi Dick,

yes, the style ES_UPPERCASE can be added or removed at runtime.

Code: Select all

<oSle>:SetStyle ( ES_UPPERCASE , <lSet> )
Regards
Karl-Heinz
Oh, nice! I was certain that this actually doesn't work at runtime, but tested it and it indeed does!
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Change SLE Resouce settings realtime

Post by ic2 »

Hello Karl-Heinz,

Thank you!

if (lUserWantsCityNotCapitalized)
SELF:oDCmCITY:SetStyle(ES_UPPERCASE,FALSE)
endif

works as I want it.
And besides, you have even taught the Master himself something new ;)

Dick
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Change SLE Resouce settings realtime

Post by Chris »

Hehe, ok but seriously if there's one master at least in this area, it's Karl-Heinz. I remember some 20 years ago when I was mostly lurking in the clcvo newsgroup and he was replying to EVERY single question regarding the Win32 API and always in a correct way of course and I was wondering how on earth he knew ALL that stuff!

That's when I decided to do A LOT of reading and try to reach a similar level myself, thinking that it would be helpful in the future. Well, it worked, I learned a lot and it did end up being very helpful :), but of course he will always be one step ahead!
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am

Change SLE Resouce settings realtime

Post by Karl-Heinz »

Part of the work is to find - and remembering of course ;-) - the places where help is provided.

e.g. https://docs.microsoft.com/en-us/window ... rol-styles ;-)

And come on Chris. What you and the Dev Team are doing day by day is incredible and incomparable. In Arnie´s words: You are the true action heroes, the true commandos and predators :-)

regards
Karl-Heinz
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Change SLE Resouce settings realtime

Post by Chris »

Karl-Heinz wrote:Part of the work is to find - and remembering of course ;-) - the places where help is provided.

e.g. https://docs.microsoft.com/en-us/window ... rol-styles ;-)
Indeed! And thanks for posting this, reading it I now understand why I had trouble in the past with the ES_READONLY property, could not change it at runtime and assumed the same would be true for ES_UPPERCASE and other as well.

But the topic above points out that in order to change it, you need to use the EM_SETREADONLY message, instead of changing ES_READONLY directly... Oh well, very glad that in Windows Forms those aspects are being handled much better and in a universal way!
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Change SLE Resouce settings realtime

Post by wriedmann »

I could not agree more:
@Chris @Fabrice @Nikos @Robert
What you and the Dev Team are doing day by day is incredible and incomparable.
Wolfgang
(the names are alfabetical order).
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Alf
Posts: 54
Joined: Wed Dec 30, 2020 10:04 am

Change SLE Resouce settings realtime

Post by Alf »

Hello to all,
my Intention is, changing controls to readonly (and also to readwrite) at runtime, but keeps the value in black color (NOT changing to lightgrey).

Need help: Can anybody teach my the correct syntax in X#:
SendMessage(self:oDCmLASTNAME:handle(), EM_SETREADONLY, ??????)

Regards
Alf
Post Reply