Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Load web browser while sleep rest of code?

Can someone help me please? I need to load the web page while the rest of the code waits for it to load, i tried so many hours but can't seem to figure it out!

Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'My.Computer.FileSystem.DeleteFile("C:\Users\Simon\Documents\Visual Studio 2010\Projects\#\#\bin\Release\captcha12.jpg")

        UseProxy(RichTextBox2.Text)
        WebBrowser1.Navigate("http://cc.cc/capt/capt.php?sc=1cve")



        Dim both As Bitmap = New Bitmap(570, 147, Imaging.PixelFormat.Format32bppArgb)
        ' Create a Graphics object that will process the screen shot
        Dim gfx As Graphics = Graphics.FromImage(both)
        ' Copy the screen contents
        gfx.CopyFromScreen(0, 0, -80, -240, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy)
        ' Save the resulting graphics

        both.Save("captcha12.jpg", Imaging.ImageFormat.Jpeg)

        PictureBox1.Image = Image.FromFile("C:\Users\Simon\Documents\Visual Studio 2010\Projects\#\#\bin\release\captcha12.jpg")



        Button4.PerformClick()

        'sw.Start()
        'Do
        'Application.DoEvents()
        ' Loop Until sw.ElapsedMilliseconds >= 5000
        'sw.Stop()


        WebBrowser1.Document.GetElementById("adcopy_response").InnerText = RichTextBox3.Text



        'My.Computer.FileSystem.DeleteFile("C:\Users\Simon\Documents\Visual Studio 2010\Projects\#\#\bin\Release\captcha12.jpg")
    End Sub
Use your DocumentComplete event to run any code after your page is finished loading..

http://msdn.microsoft.com/en-us/library/...s.85).aspx
[Image: 86251a37e635a21aea7eb7e014b0d820.gif]
(Jan 8, 2015 08:33 PM)Tedd Wrote:  Use your DocumentComplete event to run any code after your page is finished loading..

http://msdn.microsoft.com/en-us/library/...s.85).aspx
Does not work properly with proxies.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by BETAhkrMay 7, 2017 05:13 AM 10 493 May 7, 2017 05:13 AM
Last Post: Ninja
[C#] by FaXeMar 30, 2017 12:16 AM 4 229 Mar 30, 2017 12:16 AM
Last Post: FaXe
[C#] by mfqnJan 14, 2017 06:35 PM 4 257 Jan 14, 2017 06:35 PM
Last Post: Hoody