Closed Thread
Results 1 to 5 of 5

Thread: how to make a progress bar fro web browser control??

  1. #1
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    Question how to make a progress bar fro web browser control??

    hi all,
    im new to c# and im working on simple lyrics finder aplication that opens a site with a song lyrics in a web browser....
    and i wanted to make a progress bar for it but i dont know how..
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    whoiga is offline Newbie
    Join Date
    Jun 2008
    Location
    United States
    Posts
    15
    Rep Power
    0

    Re: how to make a progress bar fro web browser control??

    The easiest method in my opinion is to add a StatusStrip control to your form. This will allow you to do a multitude of status-related tasks and display the results of such in the status strip. Or, if you wanted to keep things simple, you could just add "only" a ProgressBar control to your form. I'll run you through doing it with the StatusStrip control.

    Assuming you already have a WebBrowser control on your form, named webBrowser, add a StatusStrip control to your form.

    Once the StatusStrip is in place and you have it selected, you will see a little tool icon with a drop-down arrow. Click on this, and select "ProgressBar" - this will add a ProgressBar control to the status strip. Let's assume you name it progressBar.

    Select your WebBrowser control and then view the Events in the Properties pane. Locate the ProgressChanged event and double-click it. This adds a new method to your form's .cs file that looks something like below:

    [highlight=csharp]private void webBrowser_ProgressChanged(object sender, WebBrowserProgressChangedEventArgs e)
    {

    }[/highlight]

    This method will be called on every occurrence of the ProgressChanged event.

    Inside the method, we'll do two things: 1) Set the maximum, 2) Set the value.

    To do that, modify your method so it looks like this:

    [highlight=csharp]private void webBrowser_ProgressChanged(object sender, WebBrowserProgressChangedEventArgs e)
    {
    progressBar.Maximum = Convert.ToInt32(e.MaximumProgress);
    progressBar.Value = Convert.ToInt32(e.CurrentProgress);
    }[/highlight]

    The reason we convert the e.MaximumProgress & e.CurrentProgress values to int 32s is that they are longs, and the properties of the ProgressBar control must be set using integers, not longs.

    I hope this helps. Please respond if you encounter further trouble or if this helps you along your way.
    -Martin

  4. #3
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    Re: how to make a progress bar fro web browser control??

    its working perfectly
    thank you whoiga very much, i really appreciate it
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

  5. #4
    whoiga is offline Newbie
    Join Date
    Jun 2008
    Location
    United States
    Posts
    15
    Rep Power
    0

    Re: how to make a progress bar fro web browser control??

    No problem. Cheers.
    -Martin

  6. #5
    eliasmaq is offline Newbie
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Re: how to make a progress bar fro web browser control??

    THANKS!!!!!! i was making other simple thing, a web browser, and i was looking for this for a long time ago. im also happy to know there are more people that use c#
    (im new in the forum)

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. Web Browser Control, implementing a Find function
    By DorumonSg in forum C# Programming
    Replies: 0
    Last Post: 08-23-2011, 04:51 AM
  2. Replies: 0
    Last Post: 07-13-2010, 06:43 PM
  3. How To Make Easy Web Browser in VB6!
    By ViRuSS in forum Tutorials
    Replies: 41
    Last Post: 09-03-2008, 01:11 PM
  4. does any1 know how to make a web browser in vb.net ?
    By MXTECH in forum Visual Basic Programming
    Replies: 6
    Last Post: 09-01-2008, 07:20 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts