0

Okay so, I have three pictureboxes. The first picture box has a binding source which pulls an image from an SQL data base. The two other picture boxes do not have a binding source, and cannot be given the same binding source as they are in different forms.

I need to get the image from picture box one, and have it displayed in the two picture boxes when the user changes form.

Using the following code I have got this to work:

    Private Sub GetPatImage()
       If Me.P_Image.Image IsNot Mainfrm.P_Image.Image Then
           Me.P_Image.Image = Mainfrm.P_Image.Image
       End If
    End Sub

The next issue, is that it takes a couple of seconds for picture box 1 to actually display the image in the first form. So, if the user is quick enough, the image will not be displayed on form change.

Is there a way to make the code run only when the image has been displayed properly in the first form?

1 Answers1

0

What is the first issue?

For the second one, you can use the LoadCompleted event.

CruleD
  • 1,153
  • 2
  • 7
  • 15
  • Hi, I resolved the first issue myslef with the code displayed above. How would I go about using the LoadCompleted event? – callumdarby666 Jul 29 '19 at 10:42
  • When you picture finishes loading, you do your stuff. Or prevent doing stuff before it finishes loading. – CruleD Jul 29 '19 at 13:26