HeaderPane
Main
Hide
Share Link
Print

DropOnFocus Property, SftDate Class

Defines whether the dropdown opens when the field receives the focus.

Class: SftDate
Namespace: Softelvdm.SftDateNET
Assembly: Softelvdm.SftDateNET

Syntax

public bool DropOnFocus { get; set; }
Public Property DropOnFocus As Boolean

Value

The default value is False.

Comments

Defines whether the dropdown opens when the field receives the focus.

Examples

C# View entire sample code

        private void checkRange_CheckedChanged(object sender, EventArgs e) {
            sftCalendar1.SelectionMode = checkRange.Checked ? SelectionModeEnum.Range : SelectionModeEnum.Single;
            ShowSelection();
        }

        private void checkDropOnFocus_CheckedChanged(object sender, EventArgs e) {
            foreach (SftDate field in fields)
                field.DropOnFocus = checkDropOnFocus.Checked;
        }

        private void sftCalendar1_SelectionChanged(object sender, EventArgs e) {
            ShowSelection();
        }

        private void ShowSelection() {
            CultureInfo culture = sftCalendar1.Culture ?? CultureInfo.CurrentCulture;

VB.NET View entire sample code

    Private Sub CheckRange_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles CheckRange.CheckedChanged
        SftCalendar1.SelectionMode = If(CheckRange.Checked, SelectionModeEnum.Range, SelectionModeEnum.Single)
        ShowSelection()
    End Sub

    Private Sub CheckDropOnFocus_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles CheckDropOnFocus.CheckedChanged
        For Each field As SftDate In fields
            field.DropOnFocus = CheckDropOnFocus.Checked
        Next
    End Sub

    Private Sub SftCalendar1_SelectionChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SftCalendar1.ValueChanged, SftCalendar1.RangeChanged
        ShowSelection()
    End Sub

    Private Sub ShowSelection()

See Also SftDate Class | Classes | SftDate/NET 3.0