Jump to content

UniDateTimePicker Changing Default Edit Box Hint


mos

Recommended Posts

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.

 

image.png.e8d491f79241e8b4d1ed252ae21bbbca.png

Link to comment
Share on other sites

  • 1 year later...
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;

 

Link to comment
Share on other sites

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;

 

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...