I am having a textbox and a button when i click that button calendar should get open and the selected date should display in that textbox !!!
Can anyone help me???
thank u!!!
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Upamanyu Roy Choudhury146 reputationPosted Feb 20, 2013, 9:26 PM EST
Just assign the calendar value to the textbox.
txtDate.Text = Calendar1.value
Upamanyu Roy Choudhury146 reputationPosted Feb 20, 2013, 9:35 PM EST
Satyapriya NayakRank #47 · 31.5K reputationPosted Feb 20, 2013, 10:42 PM EST
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
monthCalendar1.Visible = false;
}
private void button1_Click(object sender, EventArgs e)
{
monthCalendar1.Visible = true;
}
private void monthCalendar1_DateSelected(object sender, DateRangeEventArgs e)
{
textBox1.Text = monthCalendar1.SelectionStart.ToString("dd/MM/yyyy");
}
}
}