开发者

WPF Custom Control: How to combine 2 controls into 1?

开发者 https://www.devze.com 2023-02-08 10:15 出处:网络
I need to create a WPF custom control that will c开发者_如何学编程ombine a label and a textbox, the label being on the left and the textbox on the right, side by side. I need that kind of control beca

I need to create a WPF custom control that will c开发者_如何学编程ombine a label and a textbox, the label being on the left and the textbox on the right, side by side. I need that kind of control because I'm working on forms that all have the same pattern: label + field to fill. This control would have a LabelContent property and Text property or something like that.

Any advices on how to put that all together?

Thanks


You might want to use a UserControl instead of a CustomControl. It is designed to allow you to compose other controls into a single, reusable control.

0

精彩评论

暂无评论...
验证码 换一张
取 消