
正文
打印按钮隐藏vb.net vb打印设置代码
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
怎样用热敏打印机把vb.net窗体内文本框内容打印出来
用PrintForm控件,在Visual Basic PowerPacks项目列表中vb2008 SP1以后版本就有了,下面是代码
Imports System.Drawing.Printing
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'先设置打印页面的页边距
With Me.PrintForm1
Dim myMargins As New Margins '页边距设置信息是存放在这个Margins类型的对象中的
With myMargins '分别设置上下左右边距,
.Left = 12
.Right = 12
.Top = 12
.Bottom = 12
End With
.PrinterSettings.DefaultPageSettings.Margins = myMargins '把myMargins对象赋给PrintForm1的设置属性
End With
Me.Button1.Visible = False '这个是在打印的时候隐藏打印按钮
Me.PrintForm1.Form = Me '设置要打印的窗体
Me.PrintForm1.Print() '调用打印窗体方法
Me.Button1.Visible = True '再把隐藏的打印按钮显示出来
End Sub
相关问答
Q1: 请教VB怎么隐藏按钮?
首先在属性窗口把command2的visable设为false
command1的CLICK事件中,
if text2.text='' then
msgbox"出错"
endif
if text2.text'' then
begin
if text2.text=‘123 ’
then
begin
command2.visable=TRUE
label10.caption='正确'
end
endif
if text2.text‘123 '
begin
msgbox"结束"
unload me
end
end
endif
很简单的程序,如果有错误,请你自己调试一下,我就不到VB环境下验证了。
Q2: excel中,如何用VBA解决打印时将不需要的行和列隐藏好不打印?
Sub a隐藏()
For i = 1 To [b2].End(2).Column
If Cells(1, i) "打印" Then Cells(1, i).EntireColumn.Hidden = True
Next
For j = 1 To [b2].End(4).Row
If Cells(j, 1) = "" Then Cells(j, 1).EntireRow.Hidden = True
Next
End Sub
Sub a取消所有隐藏()
Rows("1:100").Hidden = False
Columns("A:zz").Hidden = False
End Sub
Q3: vb.net彻底隐藏文件夹
1、首先打印按钮隐藏vb.net,打开电脑,点击电脑界面中打印按钮隐藏vb.net的vbnet软件。
2、其次,点击该软件的隐藏按钮,进入隐藏界面。
3、最后,选择要隐藏的文件,点击彻底隐藏即可,是非常简单的。
关于打印按钮隐藏vb.net和vb打印设置代码的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。






