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. Managed C++/CLI
  4. dynamic pictureBox creation

dynamic pictureBox creation

Scheduled Pinned Locked Moved Managed C++/CLI
5 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?

    J 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?

      J Offline
      J Offline
      Jeff J Anderson
      wrote on last edited by
      #2

      call: gcnew PictureBox() for each. Then set the Image and other properties as desired.

      S 1 Reply Last reply
      0
      • J Jeff J Anderson

        call: gcnew PictureBox() for each. Then set the Image and other properties as desired.

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

        Hi kilroytrout, I have done this in the Form_load as follows: pictureBoxX = gcnew System::Windows::Forms::PictureBox(); pictureBoxX->Location = System::Drawing::Point(24, 262); pictureBoxX->Name = L"pictureBoxX"; pictureBoxX->Size = System::Drawing::Size(45, 49); pictureBoxX->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom; pictureBoxX->Image = Drawing::Image::FromFile("avg.jpg"); but nothing appears in the form :confused:

        J 1 Reply Last reply
        0
        • S sarah_malik

          Hi kilroytrout, I have done this in the Form_load as follows: pictureBoxX = gcnew System::Windows::Forms::PictureBox(); pictureBoxX->Location = System::Drawing::Point(24, 262); pictureBoxX->Name = L"pictureBoxX"; pictureBoxX->Size = System::Drawing::Size(45, 49); pictureBoxX->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom; pictureBoxX->Image = Drawing::Image::FromFile("avg.jpg"); but nothing appears in the form :confused:

          J Offline
          J Offline
          Jeff J Anderson
          wrote on last edited by
          #4

          Did you add each PictureBox to the form's control collection? form->Controls->Add(pictureBoxX);

          S 1 Reply Last reply
          0
          • J Jeff J Anderson

            Did you add each PictureBox to the form's control collection? form->Controls->Add(pictureBoxX);

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

            Hi kilroytrout, you helped alot thanks,

            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