How to: Display DATE format the DateTimePicker Control::
C#(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 datetimepicker_maskedtextbox
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object
sender, EventArgs e)
{
dateTimePicker1.MinDate
= DateTime.Now;
dateTimePicker1.MaxDate = dateTimePicker1.MinDate.AddDays(60);
}
private void button1_Click(object
sender, EventArgs e)
{
MessageBox.Show(dateTimePicker1.Value.ToShortDateString());
}
}
}
Comments
Post a Comment