Results 1 to 12 of 12

Thread: I need to get my tree view to download a file for each node thats selected ...VB 2013

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2014
    Posts
    20

    Resolved I need to get my tree view to download a file for each node thats selected ...VB 2013

    i am making a call of duty world at war map manager and i have a list of maps in a tree view when you select the node/map you want to download then it will show the image and about the map selected and when you hit the download button it will download the map selected

    What I need: Example: if i have Gcz Hut selected in the tree view and hit the download button it will start a progress bar and download the map thats selected and extract the contents to a folder
    im using visual studio/visual basic 2013
    Heres a img http://i58.tinypic.com/2dt7gg.png
    Last edited by greenlungs81; Sep 23rd, 2014 at 06:43 PM.

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Sep 2014
    Posts
    20

    Re: I need to get my tree view to download a file for each node thats selected ...VB

    If your having any problems understanding what i need you may look at my screen by using this link http://www.screenleap.com/greenlungs81
    Last edited by greenlungs81; Sep 22nd, 2014 at 10:47 AM.

  3. #3
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: I need to get my tree view to download a file for each node thats selected ...VB

    You really need to ask your question in the VB.NET Forum as this is VB6 and earlier


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Sep 2014
    Posts
    20

    Re: I need to get my tree view to download a file for each node thats selected ...VB

    Quote Originally Posted by jmsrickland View Post
    You really need to ask your question in the VB.NET Forum as this is VB6 and earlier
    this is a visual basic windows forum application made with visual studio

  5. #5
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: I need to get my tree view to download a file for each node thats selected ...VB

    You say you are using VB2013 and that is not VB6; it's VB.NET


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Sep 2014
    Posts
    20

    Re: I need to get my tree view to download a file for each node thats selected ...VB

    sorry im new at visual studio

  7. #7
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,579

    Re: I need to get my tree view to download a file for each node thats selected ...VB

    Save the image URL in node Tag property and use ImageLocation to show it and Image.Save to save

    Here is a working sample to start with.

    Code:
    Public Class Form1
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim n1 As New TreeNode
            Dim n2 As New TreeNode
    
            With n1
                .Text = "Pic 1"
                .Tag = "http://www.vbforums.com/images/smilies/smile.gif"
            End With
    
            With n2
                .Text = "Pic 2"
                .Tag = "http://www.vbforums.com/images/smilies/eek.gif"
            End With
    
            TreeView1.Nodes.Add(n1)
            TreeView1.Nodes.Add(n2)
    
        End Sub
    
        Private Sub TreeView1_AfterSelect(sender As Object, e As TreeViewEventArgs) Handles TreeView1.AfterSelect
            PictureBox1.ImageLocation = e.Node.Tag.ToString
        End Sub
    
    
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            PictureBox1.Image.Save("f:\" & IO.Path.GetFileName(TreeView1.SelectedNode.Tag.ToString))
        End Sub
    End Class



  8. #8

    Thread Starter
    Junior Member
    Join Date
    Sep 2014
    Posts
    20

    Re: I need to get my tree view to download a file for each node thats selected ...VB

    Quote Originally Posted by 4x2y View Post
    Save the image URL in node Tag property and use ImageLocation to show it and Image.Save to save

    Here is a working sample to start with.

    Code:
    Public Class Form1
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim n1 As New TreeNode
            Dim n2 As New TreeNode
    
            With n1
                .Text = "Pic 1"
                .Tag = "http://www.vbforums.com/images/smilies/smile.gif"
            End With
    
            With n2
                .Text = "Pic 2"
                .Tag = "http://www.vbforums.com/images/smilies/eek.gif"
            End With
    
            TreeView1.Nodes.Add(n1)
            TreeView1.Nodes.Add(n2)
    
        End Sub
    
        Private Sub TreeView1_AfterSelect(sender As Object, e As TreeViewEventArgs) Handles TreeView1.AfterSelect
            PictureBox1.ImageLocation = e.Node.Tag.ToString
        End Sub
    
    
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            PictureBox1.Image.Save("f:\" & IO.Path.GetFileName(TreeView1.SelectedNode.Tag.ToString))
        End Sub
    End Class
    i need it to download zip and rar files not img files and i dont need it to make new Nodes i already have them created everything but that is fine also how would i add a progress bar
    Heres an image of what its doing http://i.gyazo.com/d6406cc32d988211978fae0dca7e70c3.png
    Last edited by greenlungs81; Sep 22nd, 2014 at 07:01 PM.

  9. #9
    Hyperactive Member
    Join Date
    Oct 2013
    Posts
    389

    Re: I need to get my tree view to download a file for each node thats selected ...VB

    It seems you're more worried about the GUI then its functionality,
    How exactly are you planning to 'Download' the files, may i ask

  10. #10
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: I need to get my tree view to download a file for each node thats selected ...VB

    Thread moved to the VB.Net forum.

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Sep 2014
    Posts
    20

    Re: I need to get my tree view to download a file for each node thats selected ...VB

    Quote Originally Posted by stum View Post
    It seems you're more worried about the GUI then its functionality,
    How exactly are you planning to 'Download' the files, may i ask
    im going to download the files thru url the files will be rar and zip

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Sep 2014
    Posts
    20

    Re: I need to get my tree view to download a file for each node thats selected ...VB

    i got it i just added
    Code:
            If TreeView1.SelectedNode.Text = ("Gcz Hut") Then
                My.Computer.Network.DownloadFile(
        "http://www.cohowinery.com/downloads/WineList.txt",
        "C:\Users\Greenlungs81\Desktop\test\WineList.txt")
            End If
    to my download button

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