mos Posted March 30, 2022 Share Posted March 30, 2022 How can I change the default hint that show in DateTimePicker when the mouse cursor is on the edit control (see below)? I tried to set Hint and then ShowHint but that only affects the button and not the edit box area. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 31, 2022 Share Posted March 31, 2022 2 hours ago, mos said: How can I change the default hint that show in DateTimePicker when the mouse cursor is on the edit control (see below)? Hello, 1 Quote Link to comment Share on other sites More sharing options...
PS1 Posted October 9, 2023 Share Posted October 9, 2023 Hey @Sherzod, Thit solution works only with Kind = tUniDate or Kind = TUniTime. Is there solution for Kind = TUniDateTime ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 9, 2023 Share Posted October 9, 2023 1 hour ago, PS1 said: Thit solution works only with Kind = tUniDate or Kind = TUniTime. Is there solution for Kind = TUniDateTime ? Hello, Use this approach: 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.formatText = ""}' else begin ClientEvents.UniEvents.Values['date.beforeInit'] := 'function date.beforeInit(sender, config){config.formatText = ""}'; ClientEvents.UniEvents.Values['time.beforeInit'] := 'function time.beforeInit(sender, config){config.formatText = ""}'; end; end; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 9, 2023 Share Posted October 9, 2023 Or for all DateTimePickers: MainForm.Script -> Ext.form.field.Date.prototype.formatText=""; Ext.form.field.Time.prototype.formatText=""; 1 Quote Link to comment Share on other sites More sharing options...
picyka Posted October 9, 2023 Share Posted October 9, 2023 11 minutes ago, Sherzod said: Or for all DateTimePickers: MainForm.Script -> Ext.form.field.Date.prototype.formatText=""; Ext.form.field.Time.prototype.formatText=""; you gave me an incredible path... Ext.form.field.Date.prototype.formatText=""; Ext.form.field.Date.prototype.altFormats="dmY|d/m/Y|j/n/Y|j/n/y|j/m/y|d/m/y|j/m/Y|d/n/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|d-m-Y|j-n|j/n"; Ext.form.field.Date.prototype.selectOnFocus=true; Ext.form.field.Time.prototype.formatText=""; Ext.form.field.Time.prototype.altFormats="dmY|d/m/Y|j/n/Y|j/n/y|j/m/y|d/m/y|j/m/Y|d/n/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|d-m-Y|j-n|j/n"; Ext.form.field.Time.prototype.selectOnFocus=true; Quote Link to comment Share on other sites More sharing options...
PS1 Posted October 10, 2023 Share Posted October 10, 2023 Thanks for the answers, both works 1 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.