Andy

Andy

  • NA
  • 12
  • 0

composite control issue

Aug 29 2007 1:19 PM

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)