Forum > LCL
[SOLVED] Application fullscreen
(1/1)
Pe3s:
Hello, I have a question about the full screen code, why when I return to the normal screen, the application window disappears for a while and then reappears? Can I improve it?
KoBraSoft:
Hello,
your sample application does not work on my System (Xubuntu 22.04.2 LTS 64 bit, Lazarus 2.2.4 FPC 3.2.2 x86_64-linux-gtk2).
After click on button1 the Window disappear.
I usually use
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Form1.WindowState:=wsFullScreen; to switch to full screen.
I also prefer the use of ActionList1. See attached example.
PS
My first Idea
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- private FullScrn : boolean;... procedure TForm1.Action1Execute(Sender: TObject);begin if FullScrn then Form1.WindowState:=wsNormal else Form1.WindowState:=wsFullScreen; FullScrn := not FullScrn;
did not work well. I had to call Action1Execute three times to switch back to normal Screen
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- private FullScrn : boolean;... procedure TForm1.Action1Execute(Sender: TObject);begin Form1.WindowState:=wsFullScreen; if FullScrn then Form1.WindowState:=wsNormal; FullScrn := not FullScrn;
Pe3s:
Thank you :)
Navigation
[0] Message Index