| | |
On button click, I want the picturebox to load an image.
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
A THOUSAND apologies if this question has been asked time and time again.
Google gave no results and Jeeves is retired so I come looking for help in the best programming forum around.
My question is fairly simple, what do I put at the other side of the "="?
Google gave no results and Jeeves is retired so I come looking for help in the best programming forum around.
C# Syntax (Toggle Plain Text)
private void button1_Click(object sender, EventArgs e) { pictureBox1.ImageLocation=??????????? }
My question is fairly simple, what do I put at the other side of the "="?
My very first baby boy, coming December 2008. :D
•
•
Join Date: Aug 2008
Posts: 1,162
Reputation:
Solved Threads: 137
either a path or a url to the image file
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
Or you might open a filedialog in your buttonclick like this :
C# Syntax (Toggle Plain Text)
OpenFileDialog dlg = new OpenFileDialog(); dlg.Title = "Open bitmap or jpeg."; //dlg.Filter = "jpg files (*.jpg);*.jpg;*.* | bmp files (*.bmp); *.bmp"; if (dlg.ShowDialog() == DialogResult.OK) { this.fotoPictureBox.Image = new Bitmap(dlg.OpenFile()); } dlg.Dispose();
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
•
•
Join Date: Jun 2008
Posts: 58
Reputation:
Solved Threads: 9
Several ways to do it, here is an article on loading image files. Just make sure to dispose of new objects properly depending on how you load the images
Visual C# Kicks - Free C# code resources and articles.
![]() |
Similar Threads
Other Threads in the C# Forum
- Previous Thread: Assining the binary values to the checkboxes
- Next Thread: Freelance deals
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development display draganddrop drawing encryption enum event excel file files form format formbox forms formupdate function gdi+ httpwebrequest image index input install java label linux list listbox listener mandelbrot math mouseclick mysql networking operator packaging parse path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox robot serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation visualstudio webbrowser wfa windows winforms wpf xml






