Link to home
Start Free TrialLog in
Avatar of vbMarkO
vbMarkO

asked on

Code to remove controls not woking properly need help

I have multiple Picturebox 's that I nee to remove .... the coe I am using sort of works

It will clear them but I have to click multiple times

WHat can I do to clear the PB's that are in mE.PictureBox1.COntrols

Hre it is

Dim ctrl As Control
        '//////// THIS ALMOST WORKS .. just have to click it several times
        For Each ctrl In Me.PictureBox1.Controls
            If TypeOf ctrl Is PictureBox Then
                Me.PictureBox1.Controls.Remove(ctrl)
            End If
        Next

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vbMarkO
vbMarkO

ASKER

Just what I needed thanx works perfectly