datetimepicker dispose problem

A

alex

I'm running into a problem disposing the datetimepicker control. I
have a datetimepicker on a form and that form needs to 'validate' at
any given time. To do this I have to close all editing controls. The
problem is that if the drop down from the datetimepicker is open, then
calling 'dispose' on the base of the datetimepicker control results in
the month calendar display being orphaned in place. Then if you click
on it again it throws an exception. Is there some other way I'm
supposed to be programmatically closing the DateTimePicker control?
 
G

Geni

alex said:
I'm running into a problem disposing the datetimepicker control. I
have a datetimepicker on a form and that form needs to 'validate' at
any given time. To do this I have to close all editing controls. The
problem is that if the drop down from the datetimepicker is open, then
calling 'dispose' on the base of the datetimepicker control results in
the month calendar display being orphaned in place. Then if you click
on it again it throws an exception. Is there some other way I'm
supposed to be programmatically closing the DateTimePicker control?
Try this
using(...)
{
}

this dispose control imediately after }
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top