-
Sep 22nd, 2014, 10:16 AM
#1
Thread Starter
Junior Member
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.
-
Sep 22nd, 2014, 10:41 AM
#2
Thread Starter
Junior Member
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.
-
Sep 22nd, 2014, 12:33 PM
#3
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.
-
Sep 22nd, 2014, 01:12 PM
#4
Thread Starter
Junior Member
Re: I need to get my tree view to download a file for each node thats selected ...VB
Originally Posted by jmsrickland
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
-
Sep 22nd, 2014, 01:20 PM
#5
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.
-
Sep 22nd, 2014, 01:29 PM
#6
Thread Starter
Junior Member
Re: I need to get my tree view to download a file for each node thats selected ...VB
sorry im new at visual studio
-
Sep 22nd, 2014, 05:17 PM
#7
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
-
Sep 22nd, 2014, 06:42 PM
#8
Thread Starter
Junior Member
Re: I need to get my tree view to download a file for each node thats selected ...VB
Originally Posted by 4x2y
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.
-
Sep 23rd, 2014, 01:35 AM
#9
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
-
Sep 23rd, 2014, 02:51 AM
#10
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.
-
Sep 23rd, 2014, 01:48 PM
#11
Thread Starter
Junior Member
Re: I need to get my tree view to download a file for each node thats selected ...VB
Originally Posted by stum
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
-
Sep 23rd, 2014, 06:41 PM
#12
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|