Frederick Posted October 15, 2019 Share Posted October 15, 2019 I would like to select all text in a TUniDateTimePicker in the OnEnter event. How do I do this since TUniDateTimePicker(Sender).SelectAll is not a valid method? -- Frederick (UniGUI Complete - Professional Edition 1.90.0.1511) Quote Link to comment Share on other sites More sharing options...
Sanyi Posted August 25, 2021 Share Posted August 25, 2021 I need this feature too. With UniEdit works SelectAll Thanks Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted August 25, 2021 Share Posted August 25, 2021 1 hour ago, Sanyi said: I need this feature too. With UniEdit works SelectAll Thanks Hello Can you try below code? It will work if kind = tUniTime or tUniDate. procedure TMainForm.UniFormReady(Sender: TObject); begin with UniDateTimePicker1, JSInterface do begin JSConfig('selectOnFocus', [True]); end; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 25, 2021 Share Posted August 25, 2021 On 10/16/2019 at 4:16 AM, Frederick said: I would like to select all text in a TUniDateTimePicker in the OnEnter event 2 hours ago, Sanyi said: I need this feature too Hello, For all Kinds. MainForm.OnCreate event: procedure TMainForm.UniFormCreate(Sender: TObject); begin with UniDateTimePicker1 do begin if Kind in [tUniDate, tUniTime] then ClientEvents.UniEvents.Values['beforeInit'] := 'function beforeInit(sender, config){config.selectOnFocus = true}' else begin ClientEvents.UniEvents.Values['date.beforeInit'] := 'function date.beforeInit(sender, config){config.selectOnFocus = true}'; ClientEvents.UniEvents.Values['time.beforeInit'] := 'function time.beforeInit(sender, config){config.selectOnFocus = true}'; end; end; end; Quote Link to comment Share on other sites More sharing options...
Sanyi Posted August 26, 2021 Share Posted August 26, 2021 Thanks, works! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.