用下面这个方法我的写法对吗?效果是不太闪了,但会出错
e.Form.StopRedraw()
'动态增加或删除控件的代码
e.Form.ResumeRedraw()
Dim dr As DataRow
For Each f As WinForm.Form In forms
f.StopRedraw()
Dim IsOpened As Boolean = True
If f.Opened = False Then
IsOpened = False
f.Open()
f.Visible = False
End If
For Each c As Winform.Control In f.Controls
If TypeOf c Is Winform.NavBar Then
.....................................................................
Next
Else If Typeof c Is WinForm.TreeView Then
.....................................................
Next
Else If TypeOf c Is WinForm.Panel Then
Else
........................................................
Next
If IsOpened = False Then f.Close()
f.ResumeRedraw()
Next
[此贴子已经被作者于2012-11-14 16:23:32编辑过]