This is a tutorial for people who want the easy way to things like me.
You will need:
- 3 CheckBox's Named Google, YouTube and Yahoo
- 2 RadioButtons Named Image and Web
- 1 Button Named SearchButton
- Textures(Optional)
1. Make the Google Button, Checked by Default and the Web Search Selected.
2. The following codes dissables the Image and Web Button options got Google if Google isn't checked.Code:Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Google.Checked = True Web.Checked = True End Sub
3. For the Search Button the code is as follow's. "On Error Resume Next" one of the problems I found with the code I used, is that everytime you Search for something, it opens and works proply. But then you get an error with the code. To fix that I added "On Error Resume Next"Code:Private Sub Google_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Google.CheckedChanged If Web.Checked = True And Google.Checked = False Then Web.Enabled = False ElseIf Web.Checked = False And Google.Checked = False Then Web.Enabled = False ElseIf Google.Checked = True Then End If If Image.Checked = True And Google.Checked = False Then Image.Enabled = False ElseIf Image.Checked = False And Google.Checked = False Then Image.Enabled = False ElseIf Google.Checked = True Then Image.Enabled = True Yahoo.Checked = False YouTube.Checked = False End If End Sub
4. Finally, the Google, YouTube and Yahoo Check Buttons Code. This only one search method is checked at a time. If this code isn't added and you click search, you will Open 2 or 3 Different Browsers searching the same thing. Hehe.Code:Private Sub SearchButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SearchButton.Click If YouTube.Checked = True Then On Error Resume Next System.Diagnostics.Process.Start("http://youtube.com/results?search_query=" + SearchBox.Text) ElseIf Yahoo.Checked = True Then On Error Resume Next System.Diagnostics.Process.Start("http://search.yahoo.com/search?p=" + SearchBox.Text) End If If Google.Checked = True And Web.Checked = True Then On Error Resume Next System.Diagnostics.Process.Start("http://www.google.com/search?hl=en&q=" + SearchBox.Text) ElseIf Google.Checked = True And Image.Checked = True Then On Error Resume Next System.Diagnostics.Process.Start("http://images.google.ca/images?hl=en&q=" + SearchBox.Text) End If End Sub
5. If you had any textures, this is the time to add them. EnjoyCode:Private Sub Yahoo_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Yahoo.CheckedChanged If Yahoo.Checked = True Then Google.Checked = False YouTube.Checked = False End If End Sub Private Sub YouTube_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles YouTube.CheckedChanged If YouTube.Checked = True Then Yahoo.Checked = False Google.Checked = False End If End Sub Private Sub Google_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Google.CheckedChanged If Google.Checked = True Then Image.Enabled = True Web.Enabled = True YouTube.Checked = False Yahoo.Checked = False End If End Sub![]()
Last edited by Jordan; 07-25-2008 at 07:01 AM.
Nope, this is VB 9.0 (2008 Express Ed)
What Language to you use TcM?
Well, depends. I used to program in VB, but stopped. I'm learning C#, and PHP. But I know other languages, that are not so famous though...
I see. Well I've always done VB, i did 6.0 etc... now im at vb 9.0. But I know Logo programming. And I know some basic Java programming. Basic C++. But never asmuch as VB.
thanks for the tutorial ..
Great Tutorial +rep
BRILLIANT
VIvAcIoUs pAkIsTaNi
cool tutorial .. +rep![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks