0

I have a button, if I press the button, new picturebox will appear in my main form.
How to add picturebox name in the listbox ?
how to select picturebox name from a listbox for deleting the selected picturebox?

thanks...

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by GeekByChoiCe
0

I have a button, if I press the button, new picturebox will appear in my main form.
How to add picturebox name in the listbox ?
how to select picturebox name from a listbox for deleting the selected picturebox?

thanks...

C#
The picture box has a name. Something like picturebox1.name .
Then simply make something like listbox.items.add(picturebox1.name).

THere should be something similar for VP.net . Look on MS sites for properties for listbox. There are always examples also for the vb, c++ and c#.

Edited by Seten: n/a

0

now I can adding items in the list box.. thanks to Seten...

i'm still dont get any idea how to select picturebox I create form a list box. all i can do is select the last created picturebox.

0
Try
            'if the name of the picturebox is added into the listbox
            Dim picBox As PictureBox = CType(Me.Controls.Find(ListBox1.SelectedItem.ToString, True)(0), PictureBox)
            picBox.Select()
        Catch ex As Exception
            'picturebox not found
        End Try
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.