locked
Code Help RRS feed

  • Question

  • Hi,

    I've got a big problem here. I've got a Browser written in C# and I'm trying to convert the code into VB.Net and for the most part I've been able to do this. The Go button though I'm having a lot of trouble with. Can anyone tell me how to turn this into VB?

    This is the C# code for my "buttonGo".

    private void buttonGo_Click(object sender, System.EventArgs e)

    {

    System.Object nullObject = 0;

    string str = "";

    System.Object nullObjStr = str;

    Cursor.Current = Cursors.WaitCursor;

    WebBrowser.Navigate(textBox1.Text, ref nullObject, ref nullObjStr, ref nullObjStr, ref nullObjStr);

    Cursor.Current = Cursors.Default;

    }

     

    Thanx

    Thursday, February 2, 2006 4:20 PM

Answers

  • Its even easier in VB..the direct translation is as follows even though you should NOT need the null and empty string variables in VB

     

    Private sub Go_Click(byval sender as object, byval e as eventArgs) handles Go.Click

    Dim nullObject as Object = DbNull.Value

    Dim str as string = String.Empty

    Cursor.Current = Cursors.WaitCursor

    WebBrowser.Navigate(Textbox1.text, Nothing, Nothing, Nothing, Nothing)

    Cursor.Current = Cursors.Default

    End Sub

    Thursday, February 2, 2006 5:35 PM
    Moderator
  • Hi Dman1,

    If you have a beter way to make my Go button work I would appreciate your idea. Anything to make things easier I'm into. ;-)

    Thursday, February 2, 2006 11:35 PM
  • Private sub Go_Click(byval sender as object, byval e as eventArgs) handles Go.Click

         Cursor.Current = Cursors.WaitCursor

             WebBrowser.Navigate(Textbox1.text, Nothing, Nothing, Nothing, Nothing)

         Cursor.Current = Cursors.Default

    End Sub

    Friday, February 3, 2006 2:22 AM
    Moderator
  • Hi DMan1,

    I tried your suggestion and it worked great. Thanx for your help. :-)

    Sunday, February 5, 2006 7:37 AM

All replies

  • Its even easier in VB..the direct translation is as follows even though you should NOT need the null and empty string variables in VB

     

    Private sub Go_Click(byval sender as object, byval e as eventArgs) handles Go.Click

    Dim nullObject as Object = DbNull.Value

    Dim str as string = String.Empty

    Cursor.Current = Cursors.WaitCursor

    WebBrowser.Navigate(Textbox1.text, Nothing, Nothing, Nothing, Nothing)

    Cursor.Current = Cursors.Default

    End Sub

    Thursday, February 2, 2006 5:35 PM
    Moderator
  • Hi Dman1,

    If you have a beter way to make my Go button work I would appreciate your idea. Anything to make things easier I'm into. ;-)

    Thursday, February 2, 2006 11:35 PM
  • Private sub Go_Click(byval sender as object, byval e as eventArgs) handles Go.Click

         Cursor.Current = Cursors.WaitCursor

             WebBrowser.Navigate(Textbox1.text, Nothing, Nothing, Nothing, Nothing)

         Cursor.Current = Cursors.Default

    End Sub

    Friday, February 3, 2006 2:22 AM
    Moderator
  • Hi DMan1,

    I tried your suggestion and it worked great. Thanx for your help. :-)

    Sunday, February 5, 2006 7:37 AM