以 Visual Basic Windows 形式加载 pdf 文件? [英] Loading a pdf file in Visual Basic Windows form?
问题描述
我看过有关如何将 pdf 文件打开到 windows 窗体中的教程,但是它们通过创建一个可以从目录中找到它的按钮来展示如何打开它.我希望 pdf 文件已经显示,只要用户加载该窗口表单.我已经在组件工具箱中安装了 Adobe pdf 阅读器,并且将以下代码与表单的加载功能:公开课添加_工作表
I have seen tutorials on how to open pdf files into the windows form, but they show how to open it by creating a button that will find it from the directory. I want the pdf file to be displayed already, as soon as the user loads that Window form. I have installed the Adobe pdf reader in the component toolbox, and put the following code with the load function of the form: Public Class Adding_Worksheet
Private Sub Adding_Worksheet_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Call AxAcroPDF1.LoadFile(0, "D:\Mixed_Addition_1.pdf")
End Sub
End Class
我在添加 swf 文件时对此进行了调整,该文件在加载时没有问题.我知道上面的零是不正确的,但我不确定在那里写什么.我为 swf 文件添加的附加代码是 AxShockwaveFlash1.Play()
.我需要做类似 AxAcroPDF1.Load()
的事情吗?
I have adapted this from when I added an swf file, which had no problems in loading. I know the zero is incorrect above, but i am not sure what to write there. the additional code i had for the swf file was AxShockwaveFlash1.Play()
. would i need to do something like AxAcroPDF1.Load()
?
推荐答案
如果你只想显示一个 PDF 而别无他物,何不使用 System.Windows.Forms.WebBrowser 控件,并将 URL 设为 "D:\Mixed_Addition_1.pdf"?
If all you want to do is display a PDF and nothing else, why not use a System.Windows.Forms.WebBrowser control, and make the URL "D:\Mixed_Addition_1.pdf" ?
这篇关于以 Visual Basic Windows 形式加载 pdf 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!