3
Answers

composite control issue

Andy

Andy

17y
2.8k
1

I created a composite control - called DateBox - that inherits from UserControl.  It combines a DateTimePicker control (dateTimePicker1) together with a TextBox control (textBox1).  In the designer, the textbox control is overlaid on the datetimepicker control so that you see the textBox and just the arrow of the datetimepicker.  I can't get the following code to work, and I am not sure why:

void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
this.textBox1.Text = this.dateTimePicker1.Value.ToShortDateString();
}

Can anybody help me?  Thanks,

 

Answers (3)