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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Feb 21, 2013, 3:42 AM
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");
}
}
}
Upamanyu Roy ChoudhuryPosted Feb 21, 2013, 2:35 AM
Upamanyu Roy ChoudhuryPosted Feb 21, 2013, 2:26 AM
Just assign the calendar value to the textbox.
txtDate.Text = Calendar1.value