Results 1 to 2 of 2

Thread: Creating and Filling Picture Boxes Programatically

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    16

    Creating and Filling Picture Boxes Programatically

    Does anyone know how to assign a picture a a picture box programatically?

    ie

    VB Code:
    1. Dim icon as picturebox
    2. icon = new picturebox
    3. icon.image = "?"

    Cheers

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    16

    Re: Creating and Filling Picture Boxes Programatically

    I am using the .NET Compact framework and the method from file isn't supported.

    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, _
    2. ByVal e As System.EventArgs) Handles MyBase.Load
    3.         Dim images As PictureBox = New PictureBox
    4.         images.Location = New Point(20, 20)
    5.         images.Height = 200
    6.         images.Width = 200
    7.         images.Image = System.Drawing.Image("name.jpg")
    8.         Me.Controls.Add(images)
    9.     End Sub

    am working along these lines at the moment bu the System.Drawing.image results in an error!

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