Topic: display a date from DateTimePicker1 inside Memo1

display a date from DateTimePicker1 inside Memo1

Domebil

Re: display a date from DateTimePicker1 inside Memo1

Form1.Memo1.Text:= FormatDateTime('yyyy-mm-dd', Form1.DateTimePicker1.DateTime);  

3 (edited by derek 2020-06-23 10:25:27)

Re: display a date from DateTimePicker1 inside Memo1

Hi Domebil, Sibprogsistem,
I wrote this a couple of years ago - maybe it also helps.
If you leave the datetimepicker  un-ticked, it inserts today's date into the memo, if you tick the datetimepicker, it uses whatever date has been entered.
You can also use a 'hot key' instead of the mouse (in the example, it uses CTRL+D) although simply using TAB (to move focus to 'button1') and then ENTER to copy the selected date into the memo is probably just as easy.
The syntax is a bit different if you use Rich Edit instead of Memo - I have commented it in the script.
Derek.

Post's attachments

Attachment icon insert datetime into a memo.zip 336.24 kb, 265 downloads since 2020-06-23 

Re: display a date from DateTimePicker1 inside Memo1

thank you so much!
derek!

Domebil

Re: display a date from DateTimePicker1 inside Memo1

thank you so much!
sibprogsistem

Domebil