Button Help

cpgames

Member
Joined
Sep 14, 2011
Messages
14
Programming Experience
Beginner
I need help with buttons I have A tree view that when you click on a node it changes the text in text boxes and i need it to change the command the button does. So when a user clickes a node it changes text in 3 text boxes and changes the download link for the button my code is hear please help. as you can see from the code all works fine but i need to use a button to download stuff and i dont no how the download code is
VB.NET:
My.Computer.Network.DownloadFile _
    ("http://dl.dropbox.com/u/44028341/Cookie%20Pack.zip", _
    cookiepack)
        MsgBox("done")

Thats what i need the button to do



VB.NET:
Private Sub TreeView1_NodeMouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles TreeView1.NodeMouseClick
        Dim filePath As String
        filePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)


        Dim cookiepack As String
        cookiepack = filePath + "\.minecraft\texturepacks\Cookie Pack.zip"


        If e.Node.Name = "8tp1" Then
            RichTextBox1.Text = "8x8 tp 1 info"
            Label7.Text = "tp1 Author"
            Label8.Text = "tp1 verison"
            Label9.Text = "tp1 mc version"
        End If
    End Sub
 
In order to set your variable in one method and read it from another method you need to declare it at module level, see Scope in Visual Basic
 
You read the section about Module Scope and the accompanying code sample, and didn't understand it? If so I recommend you sleep on it and read it again tomorrow.
 
OK mate I have slept on it and it doest make seance I dont get how to make a button download different things depending on what node in the tree view is selected please help me
 
Oh, I must have misunderstood the question, I thought you were attempting to set a variable in one method and get the same variable value in another method.
 
Back
Top