I am developing desktop application in there are two textbox(From date and to date)
I want when click on textbox MonthCalendar Control to appear and selected date to be appear in textbox.
I googled a lot but i am not getting

Use Visible property to show/hide MonthCalendar control.

On click of textbox i am showing Calendar control and after selecting date control date is appearing in textbox but Calendar control should not appear after selecting
Following is my code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Ace_System_test
{
    public partial class Leave_Request : Form
    {
        public Leave_Request()
        {
            InitializeComponent();
        }

        private void frmdatetextBox_Click(object sender, EventArgs e)
        {
            object o = null;
            DateRangeEventArgs d = null;
            
            monthCalendar1.Visible = true;
            monthCalendar1_DateSelected(o, d);
        }

        private void monthCalendar1_DateSelected(object sender, DateRangeEventArgs e)
        {
            frmdatetextBox.Text = monthCalendar1.SelectionStart.ToLongDateString();
            
        }


        

        
    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.