制作自己的自定义控件 [英] making your own custom control

查看:97
本文介绍了制作自己的自定义控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.有人可以告诉我如何在不使用任何类(按钮,文本框等)的情况下进行自己的控制吗?

解决方案

您不能.
要制作控件,您必须从某种东西(尤其是从Control衍生出来的东西)派生它,否则它根本就不能作为Control来工作. UI中只能显示从Control类派生的项目.

最好的开始可能是 UserControl [ ^ ]或编写自定义控件:逐步 [ http://knol.google.com/k/creating-custom-controls-with -c-net# [ ^ ]


Hello everyone. can anybody tell me how can I make my own control without using any class(button,textbox, etc) ?

解决方案

You can''t.
To make a control, you must derive it from something - particularly something that derives from Control - or it will not work as a Control at all. Only items derived from the Control class can be displayed in a UI.

The best ones to start with are probably either UserControl[^] or Panel[^].


Try the below links

Writing your Custom Control: step by step[^]

http://knol.google.com/k/creating-custom-controls-with-c-net#[^]


这篇关于制作自己的自定义控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆