CodeItBetter Programming Another VB Programming Blog

How to create/remove a control in runtime

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'Controls - How to create/remove a control in runtime
'Once you have created a control array at design time, even with just one item,
'it's straightforward to create new items at run time using the Load command:

' Suppose you created Text(0) at design time.
Load Text1(1)
' Move the new control where you need it, and resize it.
Text1(1).Move 1200, 2000, 800, 350
' Set other properties as required.
Text1(1).MaxLength = 10
' ...
' Finally make it visible.
Text1(1).Visible = True
 
'You can remove controls from a control array using the Unload command, as in
'the following line of code:

Unload Text1(1)
Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.