I've just started working with Vb(2008) and im just making a basic application, if you hit yes it will download the file if you hit no it will exit.
Is there any good guides to learn from, i tried google'ing
Printable View
I've just started working with Vb(2008) and im just making a basic application, if you hit yes it will download the file if you hit no it will exit.
Is there any good guides to learn from, i tried google'ing
You could always use MSINET.OCX to connect via Interwebs to check for the latest version.
Unfortunately, there is always an error with the "OpenURL" function.
Visual Basic?
Uh
Create two buttons named Yes and No,
and state the condition for each button, it isn't that hard.
Go on youtubre and search for Web Browser Making tutorials, good pratice for beginners.
The simplest way to do that is by calling your default webbrowser with the download link and then let the browser and the user do the work. You can follow these steps, i will try to explain i full detail.
First if you havent created a new project, create one.
Then you should see a blank form titled Form1, if not look in your right panel (Solution Explorer) and double click the form1.vb file.
Open your toolbox (left panel) and drag 2 buttons anywhere in your form, one of them should be named Button1 by default and the second Button2.
To change the label on the buttons, its simple, each control ( a button, textbox etc) has some properties bound to them. For example the button's label is the Text property, so to change it... Look in your bottom right panel, that's the property panel, so now make sure you select Button1 on your form, now in the property panel scroll down until you find the "Text" property. Then alter its value to "Yes" or w.e you want it to say, now do the same for button2 and label it how you want.
After your done now we need to make the buttons do some actions. Double click the Button1 and immediately your view changes from design (visual mode) to code view. in Code view you should see something like this:
now in between Private Sub Button1_ClickCode:Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class
and End Sub type
this if this is going to be your "yes" button
now what this will do is the same as going to Start>Run... and typing in a web addressCode:Process.Start("http://link to file you want to download")
the windows shell will call up your default webbrowser and pass on that link for it to display back to the user. This is the simplest way you can let the use download a file, but its the most restrictive to the programmer aswell.
now for your "exit" button
type this in between between Private Sub Button2_Click
and it's End Sub
now there are many ways to end your program, the safest is usingbut a shorter form (taken from classic VB) is just typing "End"Code:Application.Exit()
Now to test your program look at your top toolbar and click that green arrow that looks like a play button.
I hope this has helped you :)
make button that says No
Go to the button code and write me.close
Make button that says Yes
I forgot what you shold write on the button code srry
If its similar to VB6 it would be:
Shell "C:\Program Files\Internet Explorer\iexplore.exe www.website.com"
Me.Hide