Share via


Visual Basic Reference

LinkNotify Event Example

This example is attached to a PictureBox control, Picture1, that has its LinkTopic and LinkItem properties set to specify a graphic in the source, and its LinkMode property set to 3 (Notify). When the source changes this data, the procedure updates the PictureBox control immediately only if the PictureBox is on the active form; otherwise, it sets a flag variable. This example is for illustration only.

  Private Sub Picture1_LinkNotify ()
   If Screen.ActiveForm Is Me Then
   Picture1.LinkRequest      ' Picture is on active form, so update.
   Else
      NewDataFlag = True   ' Assumed to be a module-level variable.
   End If
End Sub