Adblock breaks this site

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

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

  1. Yubbz

    Yubbz Guest

    Referrals:
    0
    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
     
  2. Blizzind

    Blizzind Grand Master
    Banned

    Joined:
    Apr 24, 2005
    Posts:
    2,805
    Referrals:
    1
    Sythe Gold:
    0
    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
     
  3. Puzzle

    Puzzle Apprentice

    Joined:
    May 6, 2005
    Posts:
    846
    Referrals:
    0
    Sythe Gold:
    0
    I wanted to make a world switcher in VB .NET 2005

    isnt that vb6?
     
  4. Blizzind

    Blizzind Grand Master
    Banned

    Joined:
    Apr 24, 2005
    Posts:
    2,805
    Referrals:
    1
    Sythe Gold:
    0
    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.
     
  5. Blizzind

    Blizzind Grand Master
    Banned

    Joined:
    Apr 24, 2005
    Posts:
    2,805
    Referrals:
    1
    Sythe Gold:
    0
    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.
     
  6. speljohan

    speljohan Guru
    Visual Basic Programmers

    Joined:
    Apr 24, 2005
    Posts:
    1,450
    Referrals:
    3
    Sythe Gold:
    0
    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
     
  7. slashshot007

    slashshot007 Active Member

    Joined:
    May 6, 2006
    Posts:
    164
    Referrals:
    0
    Sythe Gold:
    0
    I wanted to make a world switcher in VB .NET 2005

    speljohan thats the exact same thing.
     
  8. speljohan

    speljohan Guru
    Visual Basic Programmers

    Joined:
    Apr 24, 2005
    Posts:
    1,450
    Referrals:
    3
    Sythe Gold:
    0
    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 >


 
 
Adblock breaks this site