Jump to content

GotFocus TUniEdit


RobYost

Recommended Posts

I would like to create a control with TUniEdit as its ancestor.

 

I would like it to SelectAll when the user clicks or tabs to it.

 

TUniRyEdit = class(TUniEdit)
  private
  protected
    procedure GotFocus (var Msg: TMessageEvent); message CM_GOTFOCUS;
  public
  published
  end;

procedure Register;

implementation

{ TUniRyEdit }

procedure Register;
begin
  RegisterComponents('UniYostPak', [TUniRyEdit]);
end;

{ TUniRyEdit }

procedure TUniRyEdit.GotFocus(var Msg: TMessageEvent);
begin
  SelectAll;
end;

end.

But the SelectAll is never called.  Is there a better way to accomplish this? I don't want to add code to every edit control to selectall when it receives focus

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...