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. .NET (Core and Framework)
  4. dynamic pictureBox creation

dynamic pictureBox creation

Scheduled Pinned Locked Moved .NET (Core and Framework)
3 Posts 2 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
    sarah_malik
    wrote on last edited by
    #1

    Hi all, I have a form that contains one button and one textbox, the textbox will take a number that will be passed to another form. I have done this successfully. The thing is that I need the second form to create a number of pictureboxes = the number received from the first form. Any ideas?

    P 1 Reply Last reply
    0
    • S sarah_malik

      Hi all, I have a form that contains one button and one textbox, the textbox will take a number that will be passed to another form. I have done this successfully. The thing is that I need the second form to create a number of pictureboxes = the number received from the first form. Any ideas?

      P Offline
      P Offline
      Paul Selormey
      wrote on last edited by
      #2

      sarah_malik wrote:

      Any ideas?

      You have not really asked any question! Creating Picture box is well documented in the MSDN

      PictureBox picBox = new PictureBox();
      picBox.Location = new Point(0, 0);
      picBox.Size = new Size(10, 10);
      picBox.TabStop = false;
      picBox.SizeMode = PictureBoxSizeMode.StretchImage;
      picBox.BorderStyle = BorderStyle.Fixed3D;
      // Add the PictureBox to the form.
      this.Controls.Add(picBox);

      and you can loop to the number required and create any many as you wish. If your question is on positioning of the picture boxes, then if you are using .NET 2 then consider using any of the Layout Panels objects like TableLayoutPanel. Best regards, Paul.

      Jesus Christ is LOVE! Please tell somebody.

      S 1 Reply Last reply
      0
      • P Paul Selormey

        sarah_malik wrote:

        Any ideas?

        You have not really asked any question! Creating Picture box is well documented in the MSDN

        PictureBox picBox = new PictureBox();
        picBox.Location = new Point(0, 0);
        picBox.Size = new Size(10, 10);
        picBox.TabStop = false;
        picBox.SizeMode = PictureBoxSizeMode.StretchImage;
        picBox.BorderStyle = BorderStyle.Fixed3D;
        // Add the PictureBox to the form.
        this.Controls.Add(picBox);

        and you can loop to the number required and create any many as you wish. If your question is on positioning of the picture boxes, then if you are using .NET 2 then consider using any of the Layout Panels objects like TableLayoutPanel. Best regards, Paul.

        Jesus Christ is LOVE! Please tell somebody.

        S Offline
        S Offline
        sarah_malik
        wrote on last edited by
        #3

        Thank you Paul,

        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