动态控件创建 [英] Dynamic Controls creation

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

问题描述

我想在运行时创建一个文本框.使用循环我做得很好.现在我要在下一行中创建文本框.

I want to create a textbox at runtime . Using the loop i done well. Now i want to create textbox in next line.

For i1 As Integer = 0 To 3
    Dim text1 As TextBox = New TextBox()
    text1.ID = "some what"
    Page.Form.Controls.Add(New TextBox())            
Next


答案会像这样
Textbox1
Textbox2
Textbox3

但是上面的代码创建了一个像这样的文本框:textbox1 textbox2 textbox3

pls帮助我.


answer will be come on like this
Textbox1
Textbox2
Textbox3

But the Above code create a textbox like this : textbox1 textbox2 textbox3

pls help me.

推荐答案

page.form.Controls.Add(new TextBox("
"));
page.form.Controls.Add(new TextBox("
"));


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

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