AddHandler e.Form.Panel.MouseDown,AddressOf Panel_MouseDown '无边框移动
e.form.BaseForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
e.Form.BaseForm.ShowInTaskbar = True '任务栏显示图标
'-------------------------------------
Dim dr1 As DataRow = DataTables("识别日志").Find("日期 = #" & Date.Today & "#")
If dr1 IsNot Nothing Then
Tables("识别日志").Sort = "日期"
Dim idx As Integer = Tables("识别日志").FindRow(dr1)
Tables("识别日志").Position = idx
Else
dr1 = DataTables("识别日志").AddNew
dr1("日期")= Date.Today
Tables("识别日志").Sort = "日期"
Dim idx As Integer = Tables("识别日志").FindRow(dr1)
Tables("识别日志").Position = idx
End If
Dim dr As DataRow
dr = DataTables("账号秘钥").Find("默认 = true")
If dr IsNot Nothing Then
e.Form.Controls("textbox4").text = dr("APIKey")
e.Form.Controls("textbox5").text = dr("SecretKey")
e.Form.Controls("账号提示").text = "正在使用默认账号!"
Else
e.Form.Controls("账号提示").text = "正在使用系统账号!"
End If
e.Form.Controls("字体").Value = Tables("识别设置")(0,"字体")
e.Form.Controls("字号").Value = Tables("识别设置")(0,"字号")
e.Form.Controls("行距").Value = Tables("识别设置")(0,"行距")
e.Form.Controls("超时时间").Value = Tables("识别设置")(0,"超时时间")
e.Form.Controls("身份证延时").Value = Tables("识别设置")(0,"身份证延时")
e.Form.Controls("背景色").Value = Color.FromARGB(Tables("识别设置")(0,"背景色"))
e.Form.Controls("字体色").Value = Color.FromARGB(Tables("识别设置")(0,"字体色"))
e.Form.Controls("强制分段").Value = Tables("识别设置")(0,"强制分段")
e.Form.Controls("自动分段调整").Value = Tables("识别设置")(0,"自动分段调整")
Dim sp1 As WinForm.SplitContainer = e.Form.Controls("SplitContainer1")
sp1.SplitterDistance = 0
e.Form.Controls("Button15").text = ">"
Dim sp2 As WinForm.SplitContainer = e.Form.Controls("SplitContainer2")
sp2.SplitterDistance = sp2.Width * 0.30
Dim sp3 As WinForm.SplitContainer = e.Form.Controls("SplitContainer3")
sp3.SplitterDistance = sp3.Width * 0.5
SetWatermark(e.Form.Controls("TextBox6"),"起始页")
SetWatermark(e.Form.Controls("TextBox7"),"结束页")
e.Form.Controls("Button24").Visible = False '卸载PDF隐藏
'拖拽显示路径
Dim t As WinForm.TextBox = e.Form.Controls("TextBox1")
t.BaseControl.AllowDrop = True
AddHandler t.BaseControl.DragDrop, AddressOf TextBox_DragDrop
AddHandler t.BaseControl.DragEnter, AddressOf TextBox_DragEnter
'图片缩放
Dim PictureBox1 As System.Windows.Forms.panel = e.Form.Controls("图片").basecontrol
AddHandler PictureBox1.MouseWheel, AddressOf pictureBox1_MouseWheel
'图片拖拽
Dim t1 As System.windows.Forms.listview = e.Form.Controls("ListView1").basecontrol
t1.AllowDrop = True
AddHandler t1.DragDrop, AddressOf picture_DragDrop
AddHandler t1.DragEnter, AddressOf picture_DragEnter
'---------------------------
e.Form.Controls("NumericComboBox4").Visible = False '隐藏图片角度调整
'---------------------------------
Dim rt As new System.Windows.Forms.RichTextBox '定义 一个RichTextBox
rt.Dock = System.Windows.Forms.DockStyle.Fill '控件停靠方式为撑满父控件
rt.name = "RichTextBox1" '设置控件名称
UtilsSetLineSpace.SetLineSpace(rt,Tables("识别设置")(0,"行距"))
rt.borderstyle = 0 '边框
e.Form.Controls("Panelx").BaseControl.Controls.Add(rt) '控件放入Panel1中作为子控件
addhandler rt.MouseDown, addressof mytxt_MouseDown