本文介绍了在vb.net中创建打印和预览按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,在vb.net中

i首先有两个按钮用于浏览,第二个用于预览所选项目现在选择文件后立即浏览我想给出预览任何建议的选项

这里是浏览按钮的代码 -

Private Sub btnBrowse_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)处理btnBrowse.Click

使用fold作为新的OpenFileDialog

fold.Filter =文件文件(* .doc)| * .doc | richtext格式(*。rtf)| * .rtf |所有文件(*。 *)| *。*

fold.Title =选择文件

如果fold.ShowDialog()= Windows.Forms.DialogResult.OK那么

''fold.FilterIndex = 2

fold.RestoreDirectory = True

MessageBox.Show(you selected&fold.FileName)

结束如果

结束使用

结束Sub

thnx提前:)

In my applicationwhich is in vb.net
i have 2 buttons first for browse and second for preview selected item now after selecting file with browse now i want to give an option for preview any suggestion
here is the code for browse button--
Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
Using fold As New OpenFileDialog
fold.Filter = "document files (*.doc)|*.doc |richtext format(*.rtf) | *.rtf |All files (*.*)|*.*"
fold.Title = "Select file"
If fold.ShowDialog() = Windows.Forms.DialogResult.OK Then
'' fold.FilterIndex = 2
fold.RestoreDirectory = True
MessageBox.Show("You selected " & fold.FileName)
End If
End Using
End Sub
thnx in advance :)

推荐答案


这篇关于在vb.net中创建打印和预览按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 13:36