CARGAR RSS

Sub RSS() 
   RssUrl = textbox1.Text
   treeviewMENU.Nodes.Clear()


   Dim doc As New XmlDocument()
   doc.Load(RssUrl)
   Dim navigator As XPathNavigator = doc.CreateNavigator()
   Dim nodes As XPathNodeIterator = navigator.Select("/rss/channel/item/title")


   While nodes.MoveNext


       Dim node As XPathNavigator = nodes.Current
       Dim tmp As String = node.Value.Trim()
       tmp = tmp.Replace(ControlChars.CrLf, "")
       tmp = tmp.Replace(ControlChars.Lf, "")
       tmp = tmp.Replace(ControlChars.Cr, "")
       tmp = tmp.Replace(ControlChars.FormFeed, "")
       tmp = tmp.Replace(ControlChars.NewLine, "")


       treeviewMENU.Nodes.Add(tmp)


   End While


   Dim position As Integer = 0
   Dim nodesLink As XPathNodeIterator = navigator.Select("/rss/channel/item/link")


   While nodesLink.MoveNext


       Dim node As XPathNavigator = nodesLink.Current
       Dim tmp As String = node.Value.Trim()
       tmp = tmp.Replace(ControlChars.CrLf, "")
       tmp = tmp.Replace(ControlChars.Lf, "")
       tmp = tmp.Replace(ControlChars.Cr, "")
       tmp = tmp.Replace(ControlChars.FormFeed, "")
       tmp = tmp.Replace(ControlChars.NewLine, "")


       treeviewMENU.Nodes(position).Tag = tmp


       position += 1


  End While
end sub
            

Private Sub tvwRss_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles treeviewMENU.AfterSelect
        webBrowser1.Navigate(treeviewMENU.SelectedNode.tag)
End Sub


DESPLAZAR CONTROL EN TIEMPO DE EJECUCIÓN (mouse)

Private isDown As Boolean 





Private Sub move_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles move.MouseDown
      If e.Button = Windows.Forms.MouseButtons.Left Then
            isDown = True
      End If
End Sub


Private Sub move_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles move.MouseMove
      If isDown = True Then
            Panel1.Location = New Point(MousePosition.X , MousePosition.Y)
            Panel1.BringToFront()
      End If
End Sub


Private Sub move_MouseUp(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles move.MouseUp
      isDown = False
End Sub

LIBERAR MEMORIA


<DllImport("KERNEL32.DLL", EntryPoint:="SetProcessWorkingSetSize", SetLastError:=True, CallingConvention:=CallingConvention.StdCall)>
Function SetProcessWorkingSetSize(pProcess As IntPtr, dwMinimumWorkingSetSize As Integer, dwMaximumWorkingSetSize As Integer) As Boolean
End Function


<DllImport("KERNEL32.DLL", EntryPoint:="GetCurrentProcess", SetLastError:=True, CallingConvention:=CallingConvention.StdCall)>
Function GetCurrentProcess() As IntPtr
End Function

 'Funcion de liberacion de memoria
 Public Sub ClearMemory()
        Dim pHandle As IntPtr = GetCurrentProcess()
        SetProcessWorkingSetSize(pHandle, -1, -1)
 End Sub