Results 1 to 13 of 13

Thread: [RESOLVED]Change generated PictureBox locaton on mouse click

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2011
    Posts
    22

    Question [RESOLVED]Change generated PictureBox locaton on mouse click

    Hello,
    I'm trying to change the location of a generated PictureBox using code.
    It work's fine using mouse:
    Code:
     Private Sub myPictureBox_MouseDown(sender As Object, e As MouseEventArgs)
    
    
            Dim PB As PictureBox = CType(sender, PictureBox)
    
            Select Case PB.Name.ToString
                Case "PictureBox" + TextBox7.Text
                    X = Control.MousePosition.X - PB.Location.X
                    Y = Control.MousePosition.Y - PB.Location.Y
                    TextBox3.Text = PB.Width
                    TextBox2.Text = PB.Height
                  
            End Select
    
        End Sub
    but whenever I try to use a button I get this error:
    Name:  8srt.jpg
Views: 1339
Size:  226.5 KB

    I know it may be easy for You to to fix it, but I don't know how to this
    Last edited by kubau2; Oct 7th, 2013 at 08:40 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width