Click here to Skip to main content
16,004,587 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello Programmers


"Sorry For Poor English"

I am Trying To make a Program which Generate Dynamically Picture-box
as well as ContextmenStrip along all Picture Box
But i am only able to generate picture Box with ContextmenuStrip

Its Totally Confusing

m unable to identify which picturebox + Item Clicked




Dim desktop As Int16
        Dim loc As Int16
        Dim loch As Int16
        loch = 100
        desktop = 1
        Dim count As Int16
        count = 1
        loc = 100
        For desktop = 1 To 14
            Dim mypic As New PictureBox


            Dim mymenu As New ContextMenuStrip
            mypic.ContextMenuStrip = ContextMenuStrip1
            mypic.ContextMenuStrip.Name = count.ToString
            mypic.ContextMenuStrip.Items.Add(count.ToString)
            mypic.Size = New Size(80, 80)
            mypic.Location = New Point(loc, loch)
            mypic.SizeMode = PictureBoxSizeMode.StretchImage
            mypic.Image = Image.FromFile("C:\Users\DECODER\Downloads\My-Computer-icon.png")

            mypic.BringToFront()
            Me.Controls.Add(mypic)




            loc = loc + 110
            If loc > 1260 Then
                loch = 250
                loc = 100
            End If
            count = count + 1

        Next




m totally unknown about Event Handler ..

PLZ Help Me.
Posted
Comments
Sergey Alexandrovich Kryukov 3-Apr-13 19:22pm    
First of all, tag UI library you are using.
Second of all, don't use PictireBox.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900