Forum > Graphics
Run-time TPanel move
Handoko:
--- Quote from: davor on November 21, 2023, 10:21:47 am ---This is exactly the solution I was looking for.
--- End quote ---
Glad to know it is useful.
But you should pay attention about the potential issue that wp pointed out. That would be too advanced for you now, just remember if you ever have problem with this 'moving component to other form', report back.
--- Quote from: luca on November 20, 2023, 07:48:07 pm ---Generally speaking I don't like to use OnActivate event.
--- End quote ---
As a programmer, I would try and use anything that works. Is there any reason you don't like it?
--- Quote from: luca on November 20, 2023, 05:30:08 pm ---I've downloaded the code.
The Button1Click event is never fired.
Every time I click on the button the FormActivate event is triggered and nothing more happen.
--- End quote ---
I'm sorry it does not work for you. I wrote it and tested only on Linux. Did you use Windows?
--- Quote from: wp on November 20, 2023, 06:20:33 pm ---Showing the child from in Handoko's code in the OnActivate handler should be protected by some state variable preventing multiple execution:
--- End quote ---
Thank you for the improvement. I like to use global variable as little as possible, I would suggest to move that private/global variable to local:
--- 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";}};} ---procedure TMainform.FormActivate(Sender: TObject);const Activated: Boolean = false;begin if not Activated then begin Activated := true; Childform.Left := Left + Width + 10; Childform.Top := Top; Childform.Show; end;end;
Navigation
[0] Message Index
[*] Previous page