Description


DateTimePicker is designed specifically for entering dates or/and times.



Class: TdbDateTimePicker



Properties

 Property

 Type

 Description

 sqlDateTime

 String

 Returns the date and time value of the component for use in SQL queries. The property value already contains escape quotes. In the case of an empty value, it will return NULL.

 example: SQLExecute ('INSERT INTO tablename (fieldname) VALUES ('+Form1.DateTimePicker1.sqlDateTime+')');

 sqlDate

 String

 Returns the date value of the component for use in SQL queries. The property value already contains escape quotes. In the case of an empty value, it will return NULL.

 пример: SQLExecute ('INSERT INTO tablename (fieldname) VALUES ('+Form1.DateTimePicker1.sqlDate+')');

 sqlTime

 String

 Returns the time value of the component for use in SQL queries. The property value already contains escape quotes. In the case of an empty value, it will return NULL.

 пример: SQLExecute ('INSERT INTO tablename (fieldname) VALUES ('+Form1.DateTimePicker1.sqlTime+')');

 CanFocus

 Boolean

  It checks if the component can get input focus, which is usually necessary before using the SetFocus method. If a component has Visible = False or Enabled = False property, or if the component is located on a parent component with those properties, using the SetFocus method will cause an error.


example: if Form1.DateTimePicker.CanFocus then Form1.DateTimePicker1.SetFocus;

 Checked

 Boolean

 Indicates whether the check box next to the date or time is selected. Seel also ShowCheckbox.

 Cursor

 TCursor

 Specifies the image used to represent the mouse pointer when it passes into the region covered by the control. More info.

 DateTime

 TDateTime

 Indicates the date that is marked on the calendar. More info about TDateTime type

 dbFilter

 String

 Makes sense when the component is used together with the button with the "Search" action. Available values: '=', '>=', '<=', '>', '<'

 dbTable

 String

 Determines which database table a component belongs to.

 dbField

 String

 Determines which field of the database table this component belongs to.

 dbIncremSearch

 String

 Allows you to specify the name of the button on the current form with the "Search" or "SQL query" action, which will be automatically pressed when user changes the value of the component. The property is necessary to implement instant search.

 Enabled

 Boolean

 Controls whether the component responds to mouse, keyboard, and timer events.

 Focused

 Boolean

 Determines whether the control has input focus.

 Font

 TFont

 Allows you to set font name, size, color and style. More info.

 Format

 String

 Specify format for date-time string. More info.

 TimeFormat

 String

 Makes sense when Kind property = DateTime. Allows you to set the format of the time, the format of the date is set in the Format property.

 Hint

 String

 Hint contains the text string that appears when the user moves the mouse over the component., see also ShowHint

 Kind

 TAdvDateTimeKind

 Determines whether the component is a date selector,  a time selector or a date and time selector. Available values: dkDate, dkTime, dkDateTime

 MaxDate

 TDateTime

 Indicates the maximum date to which users can scroll the calendar. More info about TDateTime type

 MinDate

 TDateTime

 Indicates the minimum date that can be selected. More info about TDateTime type

 Name

 String

 The name of the component.

 ShowCheckbox

 Boolean

 Displays a check box next to the date or time.

 ShowHint

 Boolean

 Specifies whether to show the Help Hint when the mouse pointer moves over the component, see also Hint

 TabOrder

 Integer

 Indicates the position of the component in its parent's tab order. TabOrder is the order in which child components are visited when the user presses the Tab key.

 TabStop

 Boolean

 Determines whether the user can tab to a control. Use the TabStop to allow or disallow access to the control using the Tab key.

 Tag

 Integer

 Allows you to assign a number to a component for your own needs.

 TagString

 String

 Allows you to assign a string to a component for your own needs.

 Visible

 Boolean

 Specifies whether the component appears onscreen.

 Left

 Integer

 Specifies the horizontal coordinate of the left edge of a component relative to its parent.

 Top

 Integer

 Specifies the vertical coordinate of the upper-left of a component relative to its parent.

 Width

 Integer

 Specifies the horizontal size of the component in pixels.

 Height

 Integer

 Specifies the vertical size of the component in pixels.




Methods

 Method

 Description

 procedure OpenCalendar

 Opens the drop-down calendar.

 procedure SetFocus

 Gives the input focus to the component.




Events

 Event

 Description

 OnChange

 Occurs when a date or time is entered.

 OnClick

 Occurs when the user clicks the component.

 OnCloseUp

 Occurs when the drop-down calendar closes.

 OnDropDown

 Occurs when the user opens the drop-down calendar by clicking the arrow at the right of the control.

 OnEnter

 Occurs when a component receives the input focus.

 OnExit

 Occurs when the input focus shifts away from one component to another.

 OnKeyDown

 Occurs when a user presses any key while the form has focus.

 OnKeyPress

 Occurs when a key is pressed. Note that this procedure handles printable characters only.

 OnKeyUp

 Occurs when the user releases a key that was pressed.

 OnMouseEnter

 Occurs when the user moves the mouse into a component.

 OnMouseLeave

 Occurs when the user moves the mouse outside of a component.