// [1] I hope to press the Enter key, the up and down direction button instead of TAB in it back and forward procedure TFORM1.TAB (Sender: Tobject; var Key: Word; Shift: tshiftstate); begin (**) if (key = VK_Down) or (key = 13) then SelectNext (ActiveControl, True, True); if key = VK_Up then SelectNext (ActiveControl, False, True); Key: = 0; end; procedure TForm1.FormCreate (Sender: TObject); beginEdit_Name .Onkeydown: = Tab; edit_age.onkeydown: = Tab; Edit_adress.onkeydown: = Tab; End; // [2] Tissue some control objects (such as labels) and drag operations after selecting the control, to change control location procedure TForm1.Panel1MouseMove (Sender: TObject; Shift: TShiftState; X, Y: Integer); begin x_panel: = X; y_panel: = Y; end; procedure TForm1.Panel1DragOver (Sender, Source: TObject; X, Y: Integer State: TDRAGSTATE; VAR Accept: boolean; begin x_panel: = x; y_Panel: = Y; End; procedure tform1.label1mousemove (Sender: Tobject; Shift: tshiftstate; x, y: integer); recomgin x_panel: = x; Y_Panel: = Y; End; Procedure TFORM1.Label Lengthddrag (Sender, Target: Tobject; x, y: integer); begin label1.left: = x_panel-x_label; label1.top: = y_Panel-y_label; end; {[3] ==================== The string starts in the case statement ================================} function TFORM1.CASSTRING (Const S: string; const x: array s string): Integer Var i: integer; begin // (1) method results: = -1; // default return parameter for i: = low (x) to high (x) do beg IF s = x [i] the begin Result: BEGIN RESULT: = I; EXIT; End; end; // (2) method {const matchingstrings = '* first * second * third *'; var sstring: string; ... // sstring Has the data you want to test case POS '*' sstring '*'
, Matchingstrings) of 1: