如何在VB中动态添加文本框,标签和按钮? [英] How to add textboxes, labels and buttons dynamically at runtime in VB?

查看:548
本文介绍了如何在VB中动态添加文本框,标签和按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用add_subjects按钮创建一个表单,该按钮在每次单击时添加一个文本框,在VB中运行时添加相应的标签,为每个创建的文本框添加3个按钮 - 添加,编辑和删除。单击每个texbox的相应Add _button后,它会传递textbox的值传递给标签。

How to create a form with a a button add_subjects which adds one textbox on each click, at runtime in VB and a corresponding label, 3 buttons - Add, Edit and Delete, for each textbox created. Once each texbox's corresponding Add _button is clicked, it passes textbox's value is passed to the label.

推荐答案

让我谷歌那为你 [ ^ ] 。


在运行时添加几个控件,定义一个usercontrol。在那里,你将能够添加自定义属性,事件等。



看看这里:创建Windows窗体用户控件 [ ^ ]。
Instead adding several controls at runtime, define one usercontrol. There you'll be able to add custom properties, events, etc.

Have a look here: Creating a Windows Form User Control[^].


这篇关于如何在VB中动态添加文本框,标签和按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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