Deleting a Picture box - contents
delete complete the contents in picture box?
Hello guys i am creating dynamicaly combo boxes in picture box. to erase them all i am using
but only the last combo erases and the other are still there......how can i erase them all?
Re: Deleting a Picture box - contents
Re: Deleting a Picture box - contents
Try this code...
For i = 0 To 9
Unload Combos(i)
Next i
Re: Deleting a Picture box - contents
Run time error.
"Can't load or unload this object"
sorry it doesnt work.thx for the try
Re: Deleting a Picture box - contents
I don't know why Visible = False is not working for u...
The following code is working fine in my PC...
For i = 0 To 10
combos(i).Visible = False
Next i
I've used this code to load all the combo...
For p = 0 To 10
Set combos(p) = Me.Controls.Add("VB.Combobox", "cmdButton" & Me.Controls.Count, Picture1)
With combos(p)
.Left = x + 125
.Top = y
.Width = 110
.AddItem "1"
.Visible = True
End With
x = x + 300
Next p
Re: Deleting a Picture box - contents
do u use a different button for deleting?
Is it in a differebt function or in the same?
mine is in different and it still dont work
Re: Deleting a Picture box - contents
This is the code i've used...
VB Code:
Dim combos(10) As ComboBox
Private Sub DeleteCombo_Click()
For i = 0 To 10
combos(i).Visible = False
Next i
End Sub
Private Sub LoadCombo_Click()
For p = 0 To 10
Set combos(p) = Me.Controls.Add("VB.Combobox", "cmdButton" & Me.Controls.Count, Picture1)
With combos(p)
.Left = x + 125
.Top = y
.Width = 110
.AddItem "1"
.Visible = True
End With
x = x + 900
Next p
End Sub
LoadCombo button loads all the comboboxes and DeleteCombo deletes all the comboboxes
1 Attachment(s)
Re: Deleting a Picture box - contents
Here ya go. I thought you would have had a look at the other demo first however.
Re: Deleting a Picture box - contents