本文介绍了选择什么:自定义控件还是用户控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要创建一个由DatePicker和Label组成的控件.Label会告诉我们DatePicker中的星期几.该控件应该具有属性LabelVisibility(类似的东西),以便可以禁用它.它还应该能够实现样式并具有标准的控制行为.
I need to create a control which will consist of DatePicker and Label.The Label will tell us what day is pressed in DatePicker. This control should have a property LabelVisibility(something like that) to give possibility to disable it. Also it should be able to implement styles and have standart control behavior.
推荐答案我认为您没有太多选择.您需要创建一个从用户控件继承的自定义控件.自己的用户控件没有多大用处. 可以直接从马的嘴里说: UserControl类MSDN [ ^ ] Provides an empty control that can be used to create other controls. I don''t think you have much choice. You need to create a Custom Control inheriting from User Control. A user control on it''s own is not much use. Here it is directly from the Horses mouth so to speak: UserControl Class MSDN[^] Provides an empty control that can be used to create other controls.
您要描述的是UserControl.
更多推荐
选择什么:自定义控件还是用户控件?
发布评论