Marvin Gapuz

Marvin Gapuz

  • NA
  • 85
  • 6.1k

DataGridView from Form1 to PictureBox from Form2

Feb 23 2019 3:41 AM
Form 1
 
Internal class get data{
public static Image getImages { get; set; } 
private void dgv1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (!dgvMPdetails.Rows[e.RowIndex].IsNewRow)
{
 
byte[] ImageArray = (byte[])dgvMPdetails.CurrentRow.Cells[16].Value;
if(ImageArray.Length != 0)
{
ImageByteArrays = ImageArray;
getData.getImages = Image.FromStream(new MemoryStream(ImageArray));
}
getData.getNimages = dgvMPdetails.Rows[e.RowIndex].Cells[17].Value.ToString();
}
 
 
 
form 2
 
public partial class frmProductDetails : Form
{
public Image getdgvImages = frmMPdetails.getData.getImages; 
 }
 
public void loaditem()
{
pbximages.Image = getdgvImages;
 
 
Hello Please Help Me. how can I call the image inside of the datagridview to another form and display it to a picture box. Thank You so much 

Answers (2)