原創|使用教程|編輯:龔雪|2016-03-24 10:46:57.000|閱讀 384 次
概述:本次教程將向您介紹如何在 Visual Basic 開發環境下運行及使用ImageGear ActiveX控件。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Private currentPage As IGPage
Private currentPageDisp As IGPageDisplay
Private currentFileDialog As IGFileDlg
Private Sub Form_Load()
On Error GoTo ErrorHandler
IGCoreCtl1.License.SetSolutionName "Accusoft"
IGCoreCtl1.Result.NotificationFlags = IG_ERR_OLE_ERROR
IGCoreCtl1.AssociateComponent
IGFormatsCtl1.ComponentInterface
IGCoreCtl1.AssociateComponent
IGDisplayCtl1.ComponentInterface
IGDlgsCtl1.GearFormats =
IGFormatsCtl1.ComponentInterface
IGDlgsCtl1.GearCore = IGCoreCtl1.ComponentInterface
IGDlgsCtl1.GearDisplay =
IGDisplayCtl1.ComponentInterface
Set currentFileDialog = IGDlgsCtl1.CreateFileDlg
Set currentPage = IGCoreCtl1.CreatePage
Set currentPageDisp =
IGDisplayCtl1.CreatePageDisplay(currentPage)
IGPageViewCtl1.PageDisplay = currentPageDisp
IGPageViewCtl1.UpdateView
Exit Sub
ErrorHandler:
MsgBox "Errors on stack? " & IGCoreCtl1.Result.isOk &
vbCrLf & Err.Description, vbCritical, "An error has
occurred"
End Sub
Private Sub Form_Resize()
If Me.Height > 0 Then
IGPageViewCtl1.Height = Me.ScaleHeight
End If
If Me.Width > 0 Then
IGPageViewCtl1.Width = Me.ScaleWidth
End If
End Sub
Private Sub mnuOpen_Click()
On Error GoTo ErrorHandler
Dim loadDialogOptions As IGFileDlgPageLoadOptions
Set loadDialogOptions = _
IGDlgsCtl1.CreateFileDlgOptions(IG_FILEDLGOPTIONS_PAGELOADOB
J)
If currentFileDialog.Show(loadDialogOptions) Then
IGFormatsCtl1.LoadPageFromFile currentPage,
loadDialogOptions.FileName, _
loadDialogOptions.PageNum
End If
IGPageViewCtl1.UpdateView
Exit Sub
ErrorHandler:
MsgBox "Errors on stack? " & IGCoreCtl1.Result.isOk &
vbCrLf & Err.Description, vbCritical, "An error has
occurred"
End Sub
Private Sub mnuZoomIn_Click()
On Error GoTo ErrorHandler
Dim zoomzoom As IGDisplayZoomInfo
Set zoomzoom =
currentPageDisp.GetZoomInfo(IGPageViewCtl1.hWnd)
zoomzoom.HZoom = zoomzoom.HZoom * 1.25
zoomzoom.VZoom = zoomzoom.VZoom * 1.25
zoomzoom.Mode = IG_DSPL_ZOOM_H_FIXED Or
IG_DSPL_ZOOM_V_FIXED
currentPageDisp.UpdateZoomFrom zoomzoom
IGPageViewCtl1.UpdateView
Exit Sub
ErrorHandler:
MsgBox "Errors on stack? " & IGCoreCtl1.Result.isOk &
vbCrLf & Err.Description, vbCritical, "An error has
occurred"
End Sub

本教程譯自
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@ke049m.cn