How to hide a part of a WPF control
问题 Is it possible to hide a part of a WPF control? .NET 4 has a DatePicker which renders 4 parts, according to MSDN. Is it possible to hide (in my case) the TextBox part (probably named PART_TextBox)? I have seen examples of styling the DatePicker completely, and it involves alot of XAML, when all I want to do is hide one part of the control. 回答1: Well, I have a solution for your case :) class MyDateTimePicker : DatePicker { public override void OnApplyTemplate() { base.OnApplyTemplate(); var