Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Refresh problem when using MonthCalendar control in custom UITypeEditor
 

Refresh problem when using MonthCalendar control in custom UITypeEditor

Hello,

I am designing a custom editor for my component.I want to define adropdown editor that hosts a MonthCalendar control.

It works fine except that I am facing a refresh issue when using the year spinbox controlprovided byMonthCalendar. If you decrement the year using the spinbox, the calendar is not properly refreshed (all the days after the currently selected one are blank). This problem can be reproduced easily using the built-in editor for the Value property of the DateTimePicker class (just add a DateTimePicker to a Form and try to edit the Value property and you will also experience the refresh problem). Note that the MonthCalendar that is popped by the DateTimePicker control itself does not have this problem. So the issue seems to be related to the use of IWindowsFormsEditorService to drop down the editor (?)

I have not been able to find any registered bug in the support center.

Is this a known issue ?

Do you know of any workaround for this problem ?

Thanks a lot for your help

--

Cyril

Cyril Mathey  Friday, May 16, 2008 10:53 AM

Hi Cyril,

As far as I can do, I have seen the same problem just as you posted within my VS.NET 2008 using C#.

Anyway, I would like to suggest you report this problem in Microsoft Connect �Visual Studio & .NET Framework Product Feedback Center, and I believe engineers there will try to reproduce and confirm your problem, determining whether it is an issue need to be fixed.

Please feel free to let me know how your work is going on.

Thanks.

Best wishes,

Jun Wang

Jun Wang Tim  Thursday, May 22, 2008 5:48 AM

Hi Cyril,

I don't know if you are still having this problem but I ended up with the exact same thing. I tried to find an answer on the net but only found similar questions, however some info I did find said something about the MonthCalendar control being a bit querky and to get around a certain problem (different to ours) the date range needed to be set. Therefore I tried handling the DateChanged event (or I overrode the OnDateChanged method on a class that inherits MonthCalendar) in this method I simply set the SelectionEnd value to equal the SelectionStart value (in my case I only need to select one day) and it seems to redraw the control properly.

I hope this helps,

Mark.

spanky4_3  Monday, August 25, 2008 6:34 AM

Hi Cyril,

As far as I can do, I have seen the same problem just as you posted within my VS.NET 2008 using C#.

Anyway, I would like to suggest you report this problem in Microsoft Connect �Visual Studio & .NET Framework Product Feedback Center, and I believe engineers there will try to reproduce and confirm your problem, determining whether it is an issue need to be fixed.

Please feel free to let me know how your work is going on.

Thanks.

Best wishes,

Jun Wang

Jun Wang Tim  Thursday, May 22, 2008 5:48 AM

Dear Jun,

Thanks for your reply.

I have reported the problem. Anyone reading this post and who are impacted by this issue can vote for it at:

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=345461

Note that this problem in Visual Studio is lust a mild hindrance.

The problem is that I embed my editor in an Office Solution, and our users are non-technical people. They have reported this problem as a major usability issue ...

Regards

--

Cyril

Cyril Mathey  Thursday, May 22, 2008 8:09 AM

Hi Cyril,

Thanks for your feedback.

Hope engineers there could fix it as fast as possible.

Best wishes,

Jun Wang

Jun Wang Tim  Thursday, May 22, 2008 9:27 AM

Hi Cyril,

I don't know if you are still having this problem but I ended up with the exact same thing. I tried to find an answer on the net but only found similar questions, however some info I did find said something about the MonthCalendar control being a bit querky and to get around a certain problem (different to ours) the date range needed to be set. Therefore I tried handling the DateChanged event (or I overrode the OnDateChanged method on a class that inherits MonthCalendar) in this method I simply set the SelectionEnd value to equal the SelectionStart value (in my case I only need to select one day) and it seems to redraw the control properly.

I hope this helps,

Mark.

spanky4_3  Monday, August 25, 2008 6:34 AM

Mark,

Just to let you know that your workaround works nicely.

Thanks a lot for your help.

--

Cyril

Cyril Mathey  Wednesday, September 10, 2008 2:55 PM

You can use google to search for other answers

Custom Search

More Threads

• Method AddRange not found exception in Visual Studio designer
• VB.Net Encryption
• Editable Panel within UserControl
• how can i stop the IDE from being so "helpful?"
• Need to resize column
• ListView columns property is readonly and disabled in Form designer
• Printing Forms built in VS Express2005
• How to add a user control from the current project to the toolbox?
• Ù‹Windows appliction themes and skins
• Control grouping frames