如何在运行时以表格形式显示用户控件 [英] How to display usercontrol in form at run time

查看:68
本文介绍了如何在运行时以表格形式显示用户控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,
我需要在运行时以表格形式显示用户控件设计,使用一种表格我需要在运行时加载多个用户控件,请问有谁能尽快帮助我



在此先谢谢!!


我对这个任务是陌生的,可以指导我更多细节!!


I need to display user control design in form at run time , using one form i need to load several usercontrol in run time , can any one help me soon for me running out time



thanks in advance!!


I am new to this task can any guide me with more details Plz!!

can any 1 help me soon due to i am in end!!!

推荐答案

For i=1 to 10
  Dim uc as New MyUserControl
  'set location and other required properties of user control
  Me.Controls.Add(uc)
Next


首先创建用户控件的对象
First create object of your User Control
Dim MyControl As UserControl


之后,将该控件添加到表单控件"中


After that add that control in your Form Controls

Me.Controls.Add(Me.MyControl)


用户使用
形式控制的第一个注册表 <%@注册Src ="controlname" TagName =" TagPrefix ="%>
下次在需要的地方使用该控件
first reg that user control in form using
<%@ Register Src="controlname" TagName="" TagPrefix="" %>
next use that control where u want


这篇关于如何在运行时以表格形式显示用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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