Forum > Windows

[solved] need help for TEDIT component

<< < (2/3) > >>

Gald:
Use Tab and ESC for better results.
Set focus to some control on the center of the screen to see this behavior.

HeavyUser:

--- Quote from: Gald on August 06, 2022, 10:39:45 pm ---Use Tab and ESC for better results.
Set focus to some control on the center of the screen to see this behavior.

--- End quote ---
tab is the key that changes to the next control by default, which ends up calling SelectNext twice, don't use known keys, use unused keys instead, like up arrow and down arrow.

I'll have a look on the sample in a half an hour or so.

HeavyUser:
Attached is my take on the problem and here is the corrected formkeydown event for your code.

--- 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 TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin  if Key = VK_DOWN then begin // VK_Return    SelectNext(ActiveControl, True, False);    Key := 0;  end;  if Key = VK_up then  begin // VK_Escape    SelectNext(ActiveControl, False, False);    Key := 0;  end;end; 

Gald:

--- Quote from: HeavyUser on August 06, 2022, 11:10:24 pm ---tab is the key that changes to the next control by default

--- End quote ---

Three days without my sleep remedy.
I was trying to say Enter but typed TAB, sorry.


--- Quote from: HeavyUser on August 06, 2022, 11:37:26 pm ---Attached is my take on the problem and here is the corrected formkeydown event for your code.

--- End quote ---

Nice! Thank you so much!

compispezi@web.de:
Tab and ESC is not the usual way while input datas.
I only would use keydown, keyup and Enter.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version