Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim node As TreeNode = TreeView1.SelectedNode Dim rootNode As TreeNode = node Do Until rootNode.Parent Is Nothing rootNode = rootNode.Parent Loop rootNode.Text = "これがルートです。" End Sub