#1 2012-03-29 13:00:38

cocce
Member
Registered: 2011-11-02
Posts: 28

Focus a edit when SynTaskDialog is shown

Hi, I use a standard InputQuery replacemnt like this:

function InputQuery(const ACaption, APrompt: string; var Value: string): boolean;
var
  Task: TTaskDialog;
begin
  Task.Inst := ACaption;
  Task.Content := APrompt;
  Task.Query := Value;
  Result := Task.Execute([cbOk, cbCancel], 0, [tdfQuery], tiQuestion) = mrOk;
  if Result then
    Value := Task.Query;
end;

I need to focus on edit component instead the button.

Is it possibile or I have to change the FormShow method?

Thanks
Cocce

Offline

#2 2012-03-29 13:14:02

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,238
Website

Re: Focus a edit when SynTaskDialog is shown

Good idea.

I've made the following modifications:
  *  added tdfQueryFieldFocused optional flag to focus the input field component
  *  InputBox function will now focus the input field component by default

See http://synopse.info/fossil/info/0e7d678761

Offline

#3 2012-03-29 13:33:17

cocce
Member
Registered: 2011-11-02
Posts: 28

Re: Focus a edit when SynTaskDialog is shown

ab wrote:

Good idea.

I've made the following modifications:
  *  added tdfQueryFieldFocused optional flag to focus the input field component
  *  InputBox function will now focus the input field component by default

See http://synopse.info/fossil/info/0e7d678761


Veryyyyyyyyyyyyyyyyyy gooooood.

Thanks

Offline

Board footer

Powered by FluxBB