Hi dear,
i’d like to ask you if there’s a way to distinguish among the system/smartphone a user use to run an app.
In particular I encounterd issues if a user has the “dark mode” on smartphone.
Thanks in advance.
Alex
Can you explain a bit more about what you are trying to do?
I did an app without specifing the background color of the forms. I don’t use dark mode and I see white background and black text. My brother (for example) uses dark mode and sees black background and very dark text, almost unreadable.
I’d like to get the mode of the user and set a specific style.
This is what I use.
fontColour = "black"
If window.matchMedia("(prefers-color-scheme: dark)").matches = True Then
document.body.classList.toggle("dark-mode")
fontColour = "white"
End If
Your grid cells will need to have their font colour changed. A number of other controls will need to be “forced” to white as some don’t automatically change in dark mode. Quite a few do though.
Thanks a lot I’ll surely try
Best regards
Alex
Further to this, I now do this to blanket change anything in my project.
r = 0
controls = document.getElementsByTagName("*")
Do While r < controls.length
c = controls[r].id
If c.length > 3 And c.includes("_") = False Then controls[r].style.color = fontColour
r = r + 1
Loop