使用jquery.print插件
創(chuàng)新互聯(lián)專注于沂源企業(yè)網(wǎng)站建設(shè),成都響應(yīng)式網(wǎng)站建設(shè)公司,成都做商城網(wǎng)站。沂源網(wǎng)站建設(shè)公司,為沂源等地區(qū)提供建站服務(wù)。全流程專業(yè)公司,專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務(wù)
我用得jQuery.print, version 1.3.2。
頁面上調(diào)用代碼如下:PrintArea就是你panel的ID....
script src="~/Scripts/jQuery.print.js"/script
script
function printarea() {
$("#PrintArea").print({
globalStyles: true,
mediaPrint: false,
stylesheet: null,
noPrintSelector: ".no-print",
iframe: true,
append: null,
prepend: null,
manuallyCopyFormValues: true,
deferred: $.Deferred()
});
}
/script
a class="btn btn-success" onclick="printarea()"打印/a
窗體默認(rèn)是頂級控件,不能添加到其他容器中
如果想將窗體像一般控件那樣添加進(jìn)容器中,需要將窗體的TopLevel屬性設(shè)為false
如下:
Dim
fir
As
New
Form2
fir.TopLevel
=
false
Me.Panel1.Controls.Add(fir)
Public Class Form3 按下,顯示控件,并獲得焦點(diǎn). Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Visible = True TextBox1.Focus() End Sub 判斷是否獲得焦點(diǎn). Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If TextBox1.Focused = True Then MessageBox.Show("已經(jīng)獲得焦點(diǎn)了.") Else MessageBox.Show("已經(jīng)失去焦點(diǎn)了.") End If End Sub 失去焦點(diǎn)后自動陷藏. Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus TextBox1.Visible = False End Sub End Class