If e.Form.Controls("CheckBox1").Checked = False Then
e.Form.Controls("CheckBox1").Visible = False
End If
If e.Form.Controls("CheckBox2").Checked = False Then
e.Form.Controls("CheckBox2").Visible = False
End If
If e.Form.Controls("CheckBox3").Checked = False Then
e.Form.Controls("CheckBox3").Visible = False
End If
If e.Form.Controls("CheckBox4").Checked = False Then
e.Form.Controls("CheckBox4").Visible = False
End If
If e.Form.Controls("CheckBox5").Checked = False Then
e.Form.Controls("CheckBox5").Visible = False
End If
If e.Form.Controls("CheckBox6").Checked = False Then
e.Form.Controls("CheckBox6").Visible = False
End If
If e.Form.Controls("CheckBox1").Checked = True Then
e.Form.Controls("CheckBox1").Text = "" ' 清楚内容
End If
If e.Form.Controls("CheckBox2").Checked = True Then
e.Form.Controls("CheckBox2").Text = "" ' 清楚内容
End If
If e.Form.Controls("CheckBox3").Checked = True Then
e.Form.Controls("CheckBox3").Text = "" ' 清楚内容
End If
If e.Form.Controls("CheckBox4").Checked = True Then
e.Form.Controls("CheckBox4").Text = "" ' 清楚内容
End If
If e.Form.Controls("CheckBox5").Checked = True Then
e.Form.Controls("CheckBox5").Text = "" ' 清楚内容
End If
If e.Form.Controls("CheckBox6").Checked = True Then
e.Form.Controls("CheckBox6").Text = "" ' 清楚内容
End If
Dim p As WinForm.Painter = e.Form.Controls("Painter1")
Dim g As Graphics = p.Graphics
Dim w As Integer = p.width
Dim h As Integer = p.height
Dim angle As Double = 270
Dim a As Double = angle Mod 360
Dim radian As Double = a * Math.PI / 180.0
Dim cos As Double = Math.Cos(radian)
Dim sin As Double = Math.Sin(radian)
Dim newW As Integer = Math.Max(Math.Abs(w * cos - h * sin), Math.Abs(w * cos + h * sin))
Dim newH As Integer = Math.Max(Math.Abs(w * sin - h * cos), Math.Abs(w * sin + h * cos))
Dim bmpSrc As new Bitmap(newW, newH)
g.TranslateTransform(newW/2, newH/2)
g.RotateTransform(angle)
g.TranslateTransform(-newW/2, -newH/2)
'Dim x As Integer = 0
'Dim y As Integer = 0
'
Dim fnt As New Font("宋体",10)
Dim msg As String = e.form.controls("Label17").text
g.DrawString(msg,fnt,Brushes.Black,0,0)
msg = e.form.controls("Label16").text
g.DrawString(msg,fnt,Brushes.Black,30,13)
msg = e.form.controls("Label17").text
g.DrawString(msg,fnt,Brushes.Black,0,30)
msg = e.form.controls("Label16").text
g.DrawString(msg,fnt,Brushes.Black,30,43)
'p.Repaint()
e.Form.Page.Width =110 '纸张宽度为100毫米
e.Form.Page.Height = 35 '纸张高度为120毫米
e.Form.Page.LeftMargin = 0 '设置左边距
e.Form.Page.RightMargin = 0 '设置右边距
e.Form.Page.TopMargin = 0 '设置上边距
e.Form.Page.BottomMargin = 0 '设置下边距
Dim grp As WinForm.GroupBox = e.Form.Controls("GroupBox1")
Dim doc As PrintDoc = e.Form.GernatePrintDoc(grp)
doc.PageSetting.Landscape = True '横向打印
doc.Preview()
e.Form.Controls("CheckBox1").Visible = True
e.Form.Controls("CheckBox2").Visible = True
e.Form.Controls("CheckBox3").Visible = True
e.Form.Controls("CheckBox4").Visible = True
e.Form.Controls("CheckBox5").Visible = True
e.Form.Controls("CheckBox6").Visible = True
e.Form.Controls("CheckBox1").Text = "H" ' 清楚内容
e.Form.Controls("CheckBox2").Text = "S" ' 清楚内容
e.Form.Controls("CheckBox3").Text = "N" ' 清楚内容
e.Form.Controls("CheckBox4").Text = "K" ' 清楚内容
e.Form.Controls("CheckBox5").Text = "M" ' 清楚内容
e.Form.Controls("CheckBox6").Text = "P" ' 清楚内容