How to set the cursor in the hidden edit on Delphi? So that data from the keyboard is always entered into this item. Suppose I have two windows of the program. Also a text file with a combination of numbers, I enter the data from the keyboard, they are recorded in the hidden edit. After entering, I press Enter, if the entered data is edited and the file is the same, open a new window. How to implement it?

    3 answers 3

    The cursor in the hidden input field does not set. You can set an onkeypress handler for the parent form, in which the final line will be written.

    var ResultStr = ''; procedure Form1.Form1KeyPress(Sender: TObject; key: char); begin ResultStr:= ResultStr + key; end; 

    Or something like that.

      You can (Edit) not hide it, but place it under another component, for example Panel, then you can set the cursor (SetFocus) on it and the characters will be entered into it.

        @Programer , and how is hidden edith different from the usual? You set a tab on it (the input window), and prohibit the change of the input window, by means of trapping messages from the OS, or set the prohibition by calling the Win32 API functions, if possible.