Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 3rd, 2008, 06:05 AM
Member
 
Join Date: Jul 2008
Posts: 33
Default how to remove control array object at run time visual Basic 6.0

hi
my requirments is create the control array at run time that i achieved but i
couldn't remove the control array object at run time in Visual Basic 6.0
i attached the code

Private Sub Command1_Click()
Dim i As Integer
For i = 1 To 3
Load Text1(i)
Set Text1(i).Container = SSTab1
Text1(i).Visible = True
Text1(i).Move 100, 400 * i
Next
End Sub
Private Sub Command2_Click()
Do While Text1.Count >= 1
Unload Text1(Text1.UBound)
Loop
End Sub
Reply
  #2  
Old September 6th, 2008, 08:01 AM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,283
Default

Hi,

Try This :

[code=vb]
Dim i As Integer
For i = Text1.UBound To 1 Step -1
Unload Text1(i)
Next
[/code]

Regards
Veena
Reply
  #3  
Old September 6th, 2008, 05:24 PM
vdraceil's Avatar
Familiar Sight
 
Join Date: Jul 2007
Location: tamil nadu, INDIA
Age: 20
Posts: 187
Default

U got an error with your code because you tried to unload text1(0),which would be an object you added to your form at design time.you can only unload objects you added during run time.
So your code will work perfectly if you change 'text1.count>=1' to 'text1.count>1'.
Reply
  #4  
Old September 7th, 2008, 04:55 AM
Member
 
Join Date: Jul 2008
Posts: 33
Default

Thanx, It's Working Fine.
Reply
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles