Click here to Skip to main content
15,939,065 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Enter a values on textbox based to create picture boxes, to click next button to go to next picture box. At a time only one picture box will be show.. how do I show the picture box one by one
Posted
Updated 4-May-15 17:11pm
v3
Comments
Dave Kreskowiak 4-May-15 13:06pm    
and the problem is .....???
OriginalGriff 4-May-15 13:55pm    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

This is how:
C#
Control someParent = //... could be instance of Panel, or Form
                     // TabPage, or something like that
Image someImage = //... suppose you have it
PictureBox pb = new PictureBox();
pb.Image = someImage;
// other properties: BackGroundImage,
// location, Dock, and so on...
pb.Parent = someParent; // otherwise it's not used in the UI


Any problems with that?

Good luck.
—SA
 
Share this answer
 
You can add Controls in your form when running your application using this:

C#
PictureBox picBox = new PictureBox(); //Creates the control, but it doesn't show in the UI
picBox.BackgroundImage = Properties.Resources.Image_001; //An example, but you can use Image=... too.
picBox.Location = new Point(400, 320); //Defines the position of your control
picBox.Height = 100; //Defines its height
picBox.Width = 100; //Defines its width (you can also use new Size())

this.Controls.Add(picBox); //To add the control to your form.


Hope this helps - CCB
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900