一、判断 当前哪个选项卡处于打开状态
If tabControl1.SelectedTab.Name = "示教" Then
AddHandler formJog.JogComfireEvent, AddressOf dgvFileDataAddrows
End If
二、遍历所有的选项卡 并遍历里面的所有控件并写入文件保存
For Each page As TabPage In tabControl2.TabPages
For Each control As Control In page.Controls
a = a & control.Text & vbCr & vbLf
Next
b = Application.StartupPath & "\点胶机参数及示教文件\"
'文件名,文件内容,文件路径,文件后缀名
xiewenjian.Write(tbxFileName.Text, a, b, ".sjcs")
Next