I have to access photos from a file whenever I select a Combobox Index. the photo and information related to it needs to be displayed on the form. I am unsure how to access the file photo using a pathname.
Below I have a portion of my code. The combobox contains city names.
private void cmbHouseList_SelectedIndexChanged(object sender, EventArgs e)
{
if(cmbHouseList.SelectedIndex.ToString() == ofdHouse.FileName)
{
txtAddress.Text = house.Street;
txtCity.Text = house.City;
txtZip.Text = house.Postal;
txtPrice.Text = house.Price.ToString();
}
}
I assume your question is How to access the file photo using a pathname .
The answer is
string Pathname; //Whatever pathname.
Bitmap bmp = new Bitmap(Pathname);
Bang! Voila! Good luck!!!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.