Tab to a Text Memo Control on OnPreviewClick

edited July 2013 in FastReport 4.0
When a user selects a text object, a DialogPage with a memo control gets the input and displays it in the text object. How can I place the cursor inside the memo control when it pops up? The user has to click inside the box to type.
Here is the pascal code. I would like to tab to or give focus to the text area in Memo73. Thanks.
procedure Memo2OnPreviewClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
var
  s1 : string;                                              
begin
  Label2.caption:='Type information';   //Label ID on Dialog    
  Memo73.Lines.Text := TfrxMemoView(Sender).Text;      
  Memo73.visible:=True; //MemoID on dialog                                  
  DialogPage1.ShowModal;
  TfrxMemoView(Sender).Text := Memo73.Lines.Text;   //MemoID on Dialog      
  Modified := True;

end;

Comments

  • edited July 2013
    I figured it out. In the DialogPage OnShow event, I set the focus to memo73 - Memo73.SetFocus. The cursor now goes to the first position inside the text input area when the DialogPage opens. Now I would like to figure out how to get the cursor to go to the first postion after text that might have already been entered in case the user wants to pull it up again to edit.
    procedure DialogPage1OnShow(Sender: TfrxComponent);
    begin
      Memo73.SetFocus;  
    end;
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.