如何在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[^].