I'm making a TMS WEB Core website in Delphi where I want to have a button that toggles the website in and out of FullScreen (Like when you press F11 in a browser).
In FireMonkey, you have a FullScreen
property on the form to do that and then in code in an FMX app, I can literally just do the following code for that:
MyForm.FullScreen := not(MyForm.FullScreen)
The TWebForm
doesn't have a FullScreen
property.
But how can I do this on a website in a browser using Delphi and TMS WEB Core?
I wrote a little Delphi function that can toggle
FullScreen
in TMS WEB Core Websites:This should work on all modern browsers also. I tested it on Microsoft Edge, Google Chrome, and Mozilla Firefox. You can use it by simply calling
ToggleFullScreen()
in a button'sonClick
event: