Results 1 to 4 of 4

Thread: Move a Control to a PictureBox

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    273

    Move a Control to a PictureBox

    Hi!

    I got two Pictureboxes on my form. In one of the Pictureboxes i got a Label.
    Then I wan't to move the label from the first Picturebox to the other.

    How do I do this??
    Carl Odin

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Put your label within a frame (BorderStyle = None) in Picture1, then do this

    VB Code:
    1. Option Explicit
    2. Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
    3.  
    4. Private Sub Form_Load()
    5.  
    6. SetParent Frame1.hWnd, Picture2.hWnd

  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Or

    Set Label1.Container = Picture2

    No need for Frames.

  4. #4

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