WPF Custom ComboBox Control
I am using a ComboBox in my WPF application. The ComboBox has a scrolling issue that was introduced in the .NET Framework. I looked online for a solution and found that I need to create a new ComboBox that overrides OnApplyTemplate() and GetVisualChil开发者_JAVA技巧d((DependencyObject reference)) and introduces some new logic to fix the issue in these methods.
See: http://social.msdn.microsoft.com/forums/en-US/wpf/thread/0a571c75-4976-4c94-a59e-b085679a5d08/
My question, is simply, what type of control do you reckon I should create?
- Custom Control
- User Control
- Inherited from CoboBox Class - just simply create a new class that derives from ComboBox and add the methods above?
Your best bet is #3, which is what is done in the link you provided. For #1, you'd have to duplicate all of the ComboBox control code and I'm not sure you could do it with #2.
精彩评论