0

in this code when I stay on tabpage image not changed in pictureBox but when switch tabpage image show in pictureBox I need when stay on tabpage that have picturBox, image change.

    private void picLastCap3_Paint(object sender, PaintEventArgs e)

{

picture.Image = picLastCap3.Image;
picture.Update();
tabControl2.TabPages[1].Refresh();
tabControl2.TabPages[1].Update();

}

Chris Catignani
  • 5,040
  • 16
  • 42
  • 49
ashkan
  • 1
  • 3
  • on what event you want to change image, from your code seems like you want to change image of picture when piclLastCap3 's image changes, am i right? – Amit Yadav May 22 '19 at 12:36
  • yes when change image on picLastcap3 this image load and show on pictureBox in tabpage[1] when we stay on tabpage[1]. – ashkan May 22 '19 at 13:02
  • so why don't you set image of picture when u are setting image of picLastcap3 at the same time – Amit Yadav May 22 '19 at 13:23
  • and make sure your paint event is working check it by adding breakpoint inside paint event that it fires everytime when the image changes or not. – Amit Yadav May 22 '19 at 13:33
  • if not working generate event again – Amit Yadav May 22 '19 at 13:34
  • becuse setting image for picplate3 do in function and time very important after setting image in function set to picturebox out of function but I do your guide tnx alot. – ashkan May 22 '19 at 13:43

0 Answers0