|
-
May 21st, 2009, 05:53 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Add - Remove Array Textbox,label,ecc
Hi guys,
I have a problem...im able to make array of textboxes ecc...but i cant remove them...listbox has the REMOVE item fucntion...but textboxes and labels dont 
So do you have any ideas how to REMOVE an array like textbox?
This is my code for adding object arrays :
Code:
Dim intNext As Integer
Dim lngTop As Long
' find the next control
intNext = txtLoadedUser.Count
' find the next top
lngTop = txtLoadedUser(intNext - 1).Top + txtLoadedUser(intNext - 1).Height + 80
' add new controls
Load lblForumName(intNext)
Load txtLoadedUser(intNext)
Load lblWaiting(intNext)
Load txtLoadedPass(intNext)
Load txtSid(intNext)
Load txtU(intNext)
Load txtK(intNext)
With lblForumName(intNext)
.Top = lngTop
.Left = lblForumName(intNext - 1).Left
.Visible = True
End With
With txtLoadedUser(intNext)
.Top = lngTop
.Left = txtLoadedUser(intNext - 1).Left
.Visible = True
.TabIndex = txtLoadedUser(intNext - 1).TabIndex + 2
.Text = ""
End With
CHeers
Thanks for helping me out.
-
May 21st, 2009, 06:19 AM
#2
Re: Add - Remove Array Textbox,label,ecc
You can remove Controls by specifying a single index:
Code:
Unload txtLoadedUser(1)
Or in a loop (for a complete Array):
Code:
Dim lX As Long
For lX = txtLoadedUser.UBound To 1 Step -1
Unload txtLoadedUser(lX)
Next lX
However, you cannot remove items in run time that were added in design time. In your case, 0 - zero.
Creating a completely new Control array in run time requires a more complex solution. Search the forums.
-
May 21st, 2009, 06:21 AM
#3
Thread Starter
Hyperactive Member
Re: Add - Remove Array Textbox,label,ecc
Thanks for the fast reply...
WIll try that!
Thanks for helping me out.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|