ISCL is a Intelligent Information Consulting System. Based on our knowledgebase, using AI tools such as CHATGPT, Customers could customize the information according to their needs, So as to achieve

How to make a TDateTimePicker display blank

21
< Continued from page 1

A little trick is to use the letters gg in the format property. This format pattern displays the period or era. This pattern is ignored if the date to be formatted does not have an associated period or era string - which TDateTimePicker does not - thus the display is blank. When a date is subsequently selected you can then set the format to '' in the OnChange or OnClick event handler in order to get it to display again.


The format property was added in Delphi 6. In earler versions add CommCtrl to the uses clause of your unit and use the following code:

~~~~~~~~~~~~~~~~~~~~~~~~~
DateTime_SetFormat(DateTimePicker1.Handle, 'gg') ;
~~~~~~~~~~~~~~~~~~~~~~~~~

Delphi tips navigator:
» How to add a button to the IE Toolbar?
« Change the default directory Delphi uses to save projects

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.