我把红色部分放在最上面,运行没有问题,放在下面,到 tab3.SelectedPage = tab3.TabPages("page6") 就出错,主要是解决界面的闪烁问题。
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.AppStarting
If Vars("zgsdlzt") = True Then
e.Form.StopRedraw
Vars("zgsfrmsyzbdbBotton") = 1
Dim dt As DataTable
Vars("zgssyzbbdb_zgssyzbsdb") = "本年变动表"
If DataTables.Contains("listBqybdb") = False Then
Functions.Execute("zgsSyzbdbMakeLsb",dt,"zzzz18","zzzz11")
End If
Functions.Execute("zgsSyzbdbMake",dt,"zzzz18","zzzz11") '---读入数据----
'----------------------------------------------------------------------------------
Dim cob1 As WinForm.ComboBox = e.Form.Controls("ComboBox20")
cob1.Value = ""
Dim tet1 As WinForm.TextBox = e.Form.Controls("TextBox5")
tet1.Value = ""
Dim tb1 As WinForm.Table = e.Form.Controls("Table14")
tb1.Table.AllowEdit = True
tb1.Table.DataSource = DataTables("listBqybdb") '---绑定临时表
Vars("zgslistBqybdbkg") = False
Vars("listBqybdbkg") = True
tb1.Table.DataTable.GlobalHandler.DataColChanged = True '---开启全局表事件---
For Each cl As DataCol In tb1.Table.DataTable.DataCols
If cl.IsNumeric Then '---设置数字列格式
cl.SetFormat("n")
End If
If cl.name = "Bqybdb1" Then '---设置列宽度
tb1.Table.Cols(cl.name).Width = 250
Else
tb1.Table.Cols(cl.name).Width = 110
End If
Next
Functions.Execute("zgsSyzbdbCompute")
Dim tab3 As WinForm.TabControl = e.Form.Controls("TabControl3")
tab3.TabPages("page6").Visible = True
tab3.SelectedPage = tab3.TabPages("page6")
e.Form.ResumeRedraw
Else
MessageBox.Show("请登录项目","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If