Display Example VB

This example displays a user-selected image file in an Image Edit control.

Private Sub cmdDisplayImage_Click()
    'Use the ImgAdmin Open dialog box to display a file in the
    'Image Edit and Thumbnail controls.
    
    ImgAdmin1.ShowFileDialog OpenDlg
    'See the sample code for handling the Cancel key in the
    'ShowFileDialog method
    
    'Set the image properties in the Image Edit and Thumbnail controls
    'to the name of the file selected in the dialog box.
    ImgEdit1.Image = ImgAdmin1.Image
    ImgThumbnail1.Image = ImgAdmin1.Image
    'Set the page to 1 in case a page other than 1 was shown
    'for an image displayed prior to this one
    ImgEdit1.Page = 1
    ImgEdit1.Display
    'Set the focus to the image window so that keystrokes such
    'as scroll keys are sent to the image window.
    ImgEdit1.SetFocus
    
End Sub