工具创作 [英] Tools creation

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

问题描述

您好,我想知道是否可以从代码窗口中创建像文本框这样的窗体上当前不存在的工具.

Hello,I want to know if it is possible to create tools that don't exist currently on the form like textboxes from the code window.

例如,我想输入一个代码来创建一个新标签,而不仅仅是在发生特殊情况或动作时手动将其从工具箱中拉出.

For example, I want to type a code that creates a new label without just pulling it out from the tool box manually when a special condition or action occur.

非常感谢您.

推荐答案

是的,您可以这样做.该论坛中的许多主题都有创建动态控件的示例.

Yes you can do that. Many threads in this forum have examples of dynamic control creation.

但是,如果要创建的控件没有事件处理程序所需的特定事件所必需的事件处理程序子代码,则创建的控件没有必要做很多事情.

However it doesn't do much good if the control being created does not have event handler subs necessary for the specific controls use already in code if the control being created needs event handler subs to process something.

因此,只要您想知道是否可以动态创建对象,就可以了,如果您没有其他可能的必要代码来供程序中已有的对象使用,则真的无关紧要.

So just cause you want to know if an object can be dynamically created really doesn't matter if you don't have other possible necessary code for use by the object already available in your program.

how to split textbox include text(word) - Dynamic button creation, property setting and handler adding in last post in this thread. Other posts also have dynamic control creation including Labels.

您可以在此论坛中搜索其他示例,其中可能包含数千个带有示例的线程.

You can search this Forum for additional examples of which there are probably thousands of threads with examples.

此外,当不再需要不必要的对象时,也应该对其进行处理.

Also you should dispose of unecessary objects when they are no longer required.


这篇关于工具创作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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