Results 1 to 4 of 4

Thread: [2008] Help with TreeView

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2008
    Location
    Dominican Republic
    Posts
    733

    Exclamation [2008] Help with TreeView

    Hi, i'm trying to use the treeview to display the text of a rtf (rich text file) file when an specific node if clicked.

    Home
    OMG
    WOOT

    For example, if i pick OMG, i want the text of lol.rtf to be displayed on a richtextbox. But somehow i just can't manage to get it... I know to import the text of a .txt file to a textbox, but using the treeview makes it more complicated.

    This is the code im using right now:

    Code:
           Private Sub TreeView1_NodeMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles TreeView1.NodeMouseClick
            Select Case e.Node.Index
                Case 0
                    Dim file As String
                    file = My.Computer.FileSystem.ReadAllText(filename)
                    RichTextBox1.Text = file
                Case 1
                    'Same code, different file name
                Case 2
                    'Same code, different file name
                Case 3
                    'Same code, different file name
                Case 4
                    'Same code, different file name
            End Select
        End Sub
    Another thing is, that i can't import the *.rtf text into a richtextbox and i don't know why.
    Last edited by tassa; Feb 28th, 2009 at 02:10 PM.
    "In our profession, precision and perfection are not a dispensable luxury, but a simple necessity."
    Niklaus E. Wirth


    Rate any post that helped you, it's a good way of saying thanks
    Please specify your Visual Studio Version!

    Why rating is useful

    My Code Bank Submissions: How to determine Windows Version| Working With Mouse Events | Blocking Input Using API | Get host's IP | Minimize to system tray "animated" | Colored ListBox (custom fonts, colors, highlight) Updated -New Class! | [VS 2008] Strong encryption and hashing class - Updated! 31/August/2009 | Create a shortcut using IWshRuntimeLibrary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width