I wanted to make a world switcher in VB .NET 2005

Discussion in 'Programming General' started by Yubbz, Mar 11, 2007.

I wanted to make a world switcher in VB .NET 2005
  1. Unread #1 - Mar 11, 2007 at 11:24 AM
  2. Yubbz
    Referrals:
    0

    Yubbz Guest

    I wanted to make a world switcher in VB .NET 2005

    Hey guys, I'm new and obviously don't know much about visual basic. And after getting bored with HTML, I decided to try some harder coding. Anyone help me out here?

    What I have atm:

    All of the Runescape world links.
    Some ideas of what I want on the switcher.
    The name :)
    The design.


    As you can see I only need the codes, or a tutorial on how to make a link on a form.. could someone please post a tutorial on how to make a link please, and thanks in advance!

    ~Yubbz
     
  3. Unread #2 - Mar 11, 2007 at 1:09 PM
  4. Blizzind
    Joined:
    Apr 24, 2005
    Posts:
    2,805
    Referrals:
    1
    Sythe Gold:
    0

    Blizzind Grand Master
    Banned

    I wanted to make a world switcher in VB .NET 2005

    Make a command button for each world:

    Code:
    Private Sub Command1_Click()
     Webbrowser1.navigate ("link to runescape")
    end sub
    
    Stop Runescape redirection:

    Code:
    Private Sub WebBrowser_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
    On Error Resume Next
    If URL = "http://www.runescape.com/" Then Cancel = True
    End Sub
     
  5. Unread #3 - Mar 11, 2007 at 1:16 PM
  6. Puzzle
    Joined:
    May 6, 2005
    Posts:
    846
    Referrals:
    0
    Sythe Gold:
    0

    Puzzle Apprentice

    I wanted to make a world switcher in VB .NET 2005

    isnt that vb6?
     
  7. Unread #4 - Mar 11, 2007 at 1:40 PM
  8. Blizzind
    Joined:
    Apr 24, 2005
    Posts:
    2,805
    Referrals:
    1
    Sythe Gold:
    0

    Blizzind Grand Master
    Banned

    I wanted to make a world switcher in VB .NET 2005

    Oh crap I didn't know this was the .net section XP. I'll redo it.
     
  9. Unread #5 - Mar 11, 2007 at 1:51 PM
  10. Blizzind
    Joined:
    Apr 24, 2005
    Posts:
    2,805
    Referrals:
    1
    Sythe Gold:
    0

    Blizzind Grand Master
    Banned

    I wanted to make a world switcher in VB .NET 2005

    1. Make a web browser control and unlock it from the parent form.
    2. Make buttons for all the worlds.

    Double click on each button and put in:

    Code:
    WebBrowser1.Navigate("http://www.runescape.com/linktoyourworld")
    So in the end it should look almost like this:
    Code:
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            WebBrowser1.Navigate("http://www.runescape.com/linktoyourworld")
        End Sub
    Now to stop Runescape from redirecting you to the main page, add in this at the very botton of your code:

    Code:
    Private Sub WebBrowser1_Navigating(ByVal sender As Object, ByVal e As
    System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
      If (e.Url.ToString = "http://www.runescape.com/") Then
       e.Cancel = True ' cancels the redirection
      End If
    End Sub
    I've never used that code before so let me know if it works.
     
  11. Unread #6 - Mar 12, 2007 at 11:46 AM
  12. speljohan
    Joined:
    Apr 24, 2005
    Posts:
    1,450
    Referrals:
    3
    Sythe Gold:
    0

    speljohan Guru
    Visual Basic Programmers

    I wanted to make a world switcher in VB .NET 2005

    This is what i use and it works fine:
    Code:
        Private Sub WebBrowser1_Navigating(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
            If e.Url.AbsoluteUri = "http://www.runescape.com/" Then e.Cancel = True
        End Sub
     
  13. Unread #7 - Mar 12, 2007 at 7:01 PM
  14. slashshot007
    Joined:
    May 6, 2006
    Posts:
    164
    Referrals:
    0
    Sythe Gold:
    0

    slashshot007 Active Member

    I wanted to make a world switcher in VB .NET 2005

    speljohan thats the exact same thing.
     
  15. Unread #8 - Mar 13, 2007 at 12:39 PM
  16. speljohan
    Joined:
    Apr 24, 2005
    Posts:
    1,450
    Referrals:
    3
    Sythe Gold:
    0

    speljohan Guru
    Visual Basic Programmers

    I wanted to make a world switcher in VB .NET 2005

    yep, lol. BTW, technically it would be faster to make a world parser than writing all the worlds into the client. I parsed them :)
     
< [Code] Parse all runescape worlds from website! | Master Password 5.0 >

Users viewing this thread
1 guest


 
 
Adblock breaks this site