Results 1 to 7 of 7

Thread: creating picture box??Please help

  1. #1

    Thread Starter
    Addicted Member Mih_Flyer's Avatar
    Join Date
    Mar 2000
    Location
    some place there
    Posts
    241
    hello,
    I want to know how to creat a picture box or/and a text box during the run time using code,,,i really need to know how do it,,please help me and reply A.S.A.P
    thanx

  2. #2
    Guest
    Use this code. It will only work if you have VB6.[b]

    Code:
    Private Sub Command1_Click()
    
       Controls.Add "VB.Label", "Label1"
       Me!Label1.Move 0, 0
       Me!Label1.Caption = "This is my label!"
       Me!Label1.Visible = True
    
    End Sub

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    Picture Box Dynamically

    'add a picture box to a form dynamically at run time

    Option Explicit

    Private WithEvents picObj As PictureBox

    Private Sub Form_Activate()

    picObj.Print "A new picture box created dynamically!"

    End Sub


    Private Sub Form_Load()
    Set picObj = Controls.Add("VB.PictureBox", "picObj")
    With picObj
    .Visible = True
    .Width = 3000
    .Top = 1000
    .Left = 1000
    End With


    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4

    Thread Starter
    Addicted Member Mih_Flyer's Avatar
    Join Date
    Mar 2000
    Location
    some place there
    Posts
    241
    ok, thanx alot guys, what about if i want to creat an array of picturebox, like picture(0) and picture(1) and........

  5. #5

    Thread Starter
    Addicted Member Mih_Flyer's Avatar
    Join Date
    Mar 2000
    Location
    some place there
    Posts
    241
    please help me guys,,,,,,,if you don't understand me here u'll find it in another way:

    i want to creat a pictureboxes but all of them has the same name,,,like array for example : picture(0), picture(1) and picture(2) ,,,,,like that
    got it guys please help me A.S.A.P.
    thanx

  6. #6
    Guest
    You can load them from a Pre-existing PictureBox with an Index of 0. [b]

    Code:
    Load Picture1(1)
    Picture1(1).Move 0, 0
    Picture1(I).Visible = True

  7. #7

    Thread Starter
    Addicted Member Mih_Flyer's Avatar
    Join Date
    Mar 2000
    Location
    some place there
    Posts
    241
    Thanx Alot guys

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