子窗体刷新另一个子窗体怎么是实现
1个回答
推荐于2016-07-03
展开全部
Form2
code=VB.NET]Public Sub tree_view_jg()
Me.TreeView1.Nodes.Clear()
myset = New DataSet()
Using myconnect As New SqlClient.SqlConnection(My.Settings.Setting)
Dim myquery As String = "select * from dbo.depart order by up_jg_id"
mydataAdapter = New SqlClient.SqlDataAdapter(myquery, myconnect)
mydataAdapter.Fill(myset, "depart")
End Using
Dim rootTR, father As TreeNode
Me.TreeView1.TopNode = Me.TreeView1.Nodes.Add("root", "机构")
rootTR = Me.TreeView1.Nodes.Item(0)
rootTR.ContextMenuStrip = Me.CMSJG
Dim rows As DataRow
For Each rows In myset.Tables("depart").Rows
If rows("up_jg_id") = 0 Then
father = rootTR.Nodes.Add(rows("jg_id").ToString, rows("jg_name").ToString)
father.ImageIndex = rows("jg_id")
End If
Next
end sub
code=VB.NET]Public Sub tree_view_jg()
Me.TreeView1.Nodes.Clear()
myset = New DataSet()
Using myconnect As New SqlClient.SqlConnection(My.Settings.Setting)
Dim myquery As String = "select * from dbo.depart order by up_jg_id"
mydataAdapter = New SqlClient.SqlDataAdapter(myquery, myconnect)
mydataAdapter.Fill(myset, "depart")
End Using
Dim rootTR, father As TreeNode
Me.TreeView1.TopNode = Me.TreeView1.Nodes.Add("root", "机构")
rootTR = Me.TreeView1.Nodes.Item(0)
rootTR.ContextMenuStrip = Me.CMSJG
Dim rows As DataRow
For Each rows In myset.Tables("depart").Rows
If rows("up_jg_id") = 0 Then
father = rootTR.Nodes.Add(rows("jg_id").ToString, rows("jg_name").ToString)
father.ImageIndex = rows("jg_id")
End If
Next
end sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询