Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. not able to view Picture box on the form

not able to view Picture box on the form

Scheduled Pinned Locked Moved C#
graphicsquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    saksp
    wrote on last edited by
    #1

    I have written following code but It is not displayed on the form pictureBox1 = new System.Windows.Forms.PictureBox(); pictureBox1.Location = new Point(Wnd[18].Left + 2, Wnd[18].Top + 2); pictureBox1.Name = "pictureBox1"; pictureBox1.Size = new System.Drawing.Size(80, 40); pictureBox1.Image = new System.Drawing.Bitmap("c:\\bitmap1.bmp"); pictureBox1.Show(); pictureBox1.BringToFront(); what to do ?

    thanks

    T N 2 Replies Last reply
    0
    • S saksp

      I have written following code but It is not displayed on the form pictureBox1 = new System.Windows.Forms.PictureBox(); pictureBox1.Location = new Point(Wnd[18].Left + 2, Wnd[18].Top + 2); pictureBox1.Name = "pictureBox1"; pictureBox1.Size = new System.Drawing.Size(80, 40); pictureBox1.Image = new System.Drawing.Bitmap("c:\\bitmap1.bmp"); pictureBox1.Show(); pictureBox1.BringToFront(); what to do ?

      thanks

      T Offline
      T Offline
      Tom Deketelaere
      wrote on last edited by
      #2

      you have to add the control to the form Form1.controls.add(picturebox1);

      1 Reply Last reply
      0
      • S saksp

        I have written following code but It is not displayed on the form pictureBox1 = new System.Windows.Forms.PictureBox(); pictureBox1.Location = new Point(Wnd[18].Left + 2, Wnd[18].Top + 2); pictureBox1.Name = "pictureBox1"; pictureBox1.Size = new System.Drawing.Size(80, 40); pictureBox1.Image = new System.Drawing.Bitmap("c:\\bitmap1.bmp"); pictureBox1.Show(); pictureBox1.BringToFront(); what to do ?

        thanks

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        Have you forgot formObject.Controls.Add(pictureBox1)?

        Navaneeth How to use google | Ask smart questions

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups