Forum > General
[Solved] Setting form focus
madref:
i am keeping track of which form are being shown on my screen. I use the following array to keep track of them
--- 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";}};} ---type TMyForms = record Index: Integer; Naam: string; end; // TMyForms var MyForms: Array [0..9] of TMyForms;
How can i now set the form that is stored in my MyForms when the index is lets say 2.
jamie:
SetFocus ?
madref:
can't get that to work
Is there a way to set the focus of a named form instead of using the index?
TRon:
--- Quote from: madref on July 29, 2024, 11:04:19 pm ---i am keeping track of which form are being shown on my screen. I use the following array to keep track of them
...
How can i now set the form that is stored in my MyForms when the index is lets say 2.
--- End quote ---
What does that mean, set the form ? If you do not know the correct terminology then try to describe what it is that you want to happen for that say form 2.
madref:
Oke let's try that again
the steps i am taking to open several forms.
open forrm 1
store in MyForms as [0, 'Form1']
Open form 2
Store in MyForm as [1, 'Form2']
Open form 3
Sore in MyForm as [2, 'Form3']
do some stuff on form 3 and then use a question form [Just a simple yes or no] to close form 3
Now i want to set the active form to form 2.
HOW DO I DO THAT?
--- 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";}};} --- Screen.Forms[LintIndex].SetFocus; does not work
Also read this https://forum.lazarus.freepascal.org/index.php/topic,68046.0.html
Navigation
[0] Message Index
[#] Next page