Class DateTimePickerControl
Represents a Windows control that allows the user to select a date and a time and to display the date and time with a specified format. Wraps the System.Windows.Forms.DateTimePicker control.
Inheritance
Inherited Members
Namespace: FastReport.Dialog
Assembly: FastReport.dll
Syntax
public class DateTimePickerControl : DataFilterBaseControl, IComponent, IDisposable, IFRSerializable, IHasEditor
Constructors
DateTimePickerControl()
Initializes a new instance of the DateTimePickerControl class with default settings.
Declaration
public DateTimePickerControl()
Properties
Checked
Gets or sets a value indicating whether the Value property has been set with a valid date/time value and the displayed value is able to be updated. Wraps the System.Windows.Forms.DateTimePicker.Checked property.
Declaration
public bool Checked { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
CustomFormat
Gets or sets the custom date/time format string. Wraps the System.Windows.Forms.DateTimePicker.CustomFormat property.
Declaration
public string CustomFormat { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DateTimePicker
Gets an internal DateTimePicker.
Declaration
[Browsable(false)]
public DateTimePicker DateTimePicker { get; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.DateTimePicker |
DropDownAlign
Gets or sets the alignment of the drop-down calendar on the DateTimePicker control. Wraps the System.Windows.Forms.DateTimePicker.DropDownAlign property.
Declaration
public LeftRightAlignment DropDownAlign { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.LeftRightAlignment |
Format
Gets or sets the format of the date and time displayed in the control. Wraps the System.Windows.Forms.DateTimePicker.Format property.
Declaration
public DateTimePickerFormat Format { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.DateTimePickerFormat |
MaxDate
Gets or sets the maximum date and time that can be selected in the control. Wraps the System.Windows.Forms.DateTimePicker.MaxDate property.
Declaration
public DateTime MaxDate { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
MinDate
Gets or sets the minimum date and time that can be selected in the control. Wraps the System.Windows.Forms.DateTimePicker.MinDate property.
Declaration
public DateTime MinDate { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
ShowCheckBox
Gets or sets a value indicating whether a check box is displayed to the left of the selected date. Wraps the System.Windows.Forms.DateTimePicker.ShowCheckBox property.
Declaration
public bool ShowCheckBox { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ShowUpDown
Gets or sets a value indicating whether a spin button control (also known as an up-down control) is used to adjust the date/time value. Wraps the System.Windows.Forms.DateTimePicker.ShowUpDown property.
Declaration
public bool ShowUpDown { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Text
This property is not relevant to this class.
Declaration
[Browsable(false)]
public override string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Value
Gets or sets the date/time value assigned to the control. Wraps the System.Windows.Forms.DateTimePicker.Value property.
Declaration
public DateTime Value { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
ValueChangedEvent
Gets or sets a script method name that will be used to handle the ValueChanged event.
Declaration
public string ValueChangedEvent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
AttachEvents()
Attaches Control events to its event handlers.
Declaration
protected override void AttachEvents()
Overrides
Remarks
Override this method if your custom control has own events.
DetachEvents()
Detaches Control events from its event handlers.
Declaration
protected override void DetachEvents()
Overrides
Remarks
Override this method if your custom control has own events. In this method, you should detach control's events that were attached in the AttachEvents() method.
GetSelectionPoints()
Gets the object's selection points.
Declaration
protected override SelectionPoint[] GetSelectionPoints()
Returns
Type | Description |
---|---|
SelectionPoint[] | Array of SelectionPoint objects. |
Overrides
Remarks
Selection point is a small square displayed at the object's sides when object is selected in the designer. You can drag this square by the mouse to change the object's size. For example, the TextObject has eight selection points to change its width and height by the mouse.
If you are developing a new component for FastReport, you may override this method if your object has non-standard set of selection points. For example, if an object has something like "AutoSize" property, it would be good to disable all selection points if that property is true, to disable resizing of the object by the mouse.
GetValue()
Returns value entered in the control.
Declaration
protected override object GetValue()
Returns
Type | Description |
---|---|
System.Object | The value of type supported by this control. |
Overrides
Remarks
This method must return a value entered by the user. For example, TextBox control must return its Text property value. If this control supports multi-selection, return selected values in an array, for example string[] array for CheckedListBox.
OnValueChanged(EventArgs)
This method fires the ValueChanged event and the script code connected to the ValueChangedEvent.
Declaration
public virtual void OnValueChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Event data. |
Serialize(FRWriter)
Serializes the object.
Declaration
public override void Serialize(FRWriter writer)
Parameters
Type | Name | Description |
---|---|---|
FRWriter | writer | Writer object. |
Overrides
Remarks
Do not call this method directly. You should override it if you are developing a new component for FastReport.
This method is called when the object needs to save the state. It may happen when:
- saving the report to the file or stream;
- saving the report to the designer's undo buffer;
- assigning the object to another object using the Assign(Base) or AssignAll methods;
- saving the object to the designer's clipboard;
- saving the object to the preview (when run a report).
ShouldSerializeBackColor()
Determines whether is necessary to serialize the BackColor property.
Declaration
protected override bool ShouldSerializeBackColor()
Returns
Type | Description |
---|---|
System.Boolean | true if serialization is necessary. |
Overrides
ShouldSerializeForeColor()
Determines whether is necessary to serialize the ForeColor property.
Declaration
protected override bool ShouldSerializeForeColor()
Returns
Type | Description |
---|---|
System.Boolean | true if serialization is necessary. |
Overrides
Events
ValueChanged
Occurs after the date has been changed. Wraps the System.Windows.Forms.DateTimePicker.ValueChanged event.
Declaration
public event EventHandler ValueChanged
Event Type
Type | Description |
---|---|
System.EventHandler |