Jump to content

trying to fix this code, please help

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Paulo_Jorge

Paulo_Jorge

    Learning Programmer

  • Members
  • PipPipPip
  • 54 posts
i have this code here

 Dim icon As New System.Windows.Forms.PictureBox()

        With icon

            .BackColor = Color.Transparent

            .Enabled = True

            .Visible = True

            .Size = New Point(40, 40)

            .Image = PictureBox1.Image

            .SizeMode = PictureBoxSizeMode.StretchImage

            .Location = New Point(680, 12)

        End With

        Desktop.Controls.Add(icon)

        Me.Hide()

with this i create a new picture box in the form; the problem is: how i can program the click event of the new picture box? i really need to know

please answer, thanks

#2
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 856 posts
  • Location:Arkansas
Assuming your click handler function is named icon_Click(), use this code:

AddHandler icon.Click, AddressOf icon_Click


Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#3
Paulo_Jorge

Paulo_Jorge

    Learning Programmer

  • Members
  • PipPipPip
  • 54 posts
thanks, worked




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users