Webbrowser help

Discussion in 'Programming General' started by hampe-92, Oct 10, 2008.

Webbrowser help
  1. Unread #1 - Oct 10, 2008 at 2:29 PM
  2. hampe-92
    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    hampe-92 Forum Addict

    Webbrowser help

    Hi
    I'm working on a litle webbrowser project to train my C# skills...
    When i write something in the URL bar then I want to be able to just hit enter and the page will load.. but as it is now I have to go click the Go button which pretty much sucks... so, I would realy appreciate any help :)
    I've googled it but I haven't found anything that I can get working...
    Thx in advance!

    EDIT: One more thing.. I can't get the progressbar to work... :S?
     
  3. Unread #2 - Oct 11, 2008 at 1:22 AM
  4. exapto
    Joined:
    Oct 10, 2008
    Posts:
    645
    Referrals:
    0
    Sythe Gold:
    123
    Vouch Thread:
    Click Here
    Discord Unique ID:
    716746285151027321
    Discord Username:
    exapto#2360
    Homosex

    exapto #1 OSRS Magic Training Service
    $50 USD Donor New

    Webbrowser help

    well, you could lookup a sample visual basic web browser module and try to program around it in a C# environment. I'm not sure about the progress bar....
     
  5. Unread #3 - Oct 11, 2008 at 1:23 AM
  6. exapto
    Joined:
    Oct 10, 2008
    Posts:
    645
    Referrals:
    0
    Sythe Gold:
    123
    Vouch Thread:
    Click Here
    Discord Unique ID:
    716746285151027321
    Discord Username:
    exapto#2360
    Homosex

    exapto #1 OSRS Magic Training Service
    $50 USD Donor New

    Webbrowser help

    well, you could lookup a visual basic web browser module and program around that in a C# environment. I can't help you with the progress bar at the moment....
     
  7. Unread #4 - Oct 11, 2008 at 1:36 AM
  8. PinBuyer_
    Joined:
    Oct 10, 2008
    Posts:
    140
    Referrals:
    0
    Sythe Gold:
    3

    PinBuyer_ Active Member
    Banned

    Webbrowser help

    Put this in the KeyPress event of the textbox:

    Code:
         if (Strings.AscW(e.KeyChar) == 13) {
             WebBrowser.Navigate(txtURL.Text);
         }
     
  9. Unread #5 - Oct 11, 2008 at 6:10 AM
  10. hampe-92
    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    hampe-92 Forum Addict

    Webbrowser help

    hmm... can u explain what the (Strings.AscW part means? and what is 13?
     
  11. Unread #6 - Oct 11, 2008 at 6:20 AM
  12. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    Webbrowser help

    Look in the KeyDown, KeyPress and KeyUp events of your textbox. Place the code for your button in to a method, then call that method from your desired events.
     
  13. Unread #7 - Oct 11, 2008 at 8:49 AM
  14. hampe-92
    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    hampe-92 Forum Addict

    Webbrowser help

    ok.. thx guys... I managed to figure it out... this is what I got
    Code:
     
    void toolStripTextBox1_KeyDown(object sender, KeyEventArgs e) 
    { 
         if (e.KeyCode == Keys.Enter)
            {
                webBrowser1.Navigate(toolStripTextBox1.Text);
            }
    }
    
    and Swan, you're my idol :p
     
  15. Unread #8 - Oct 11, 2008 at 9:33 AM
  16. exapto
    Joined:
    Oct 10, 2008
    Posts:
    645
    Referrals:
    0
    Sythe Gold:
    123
    Vouch Thread:
    Click Here
    Discord Unique ID:
    716746285151027321
    Discord Username:
    exapto#2360
    Homosex

    exapto #1 OSRS Magic Training Service
    $50 USD Donor New

    Webbrowser help

    Thats actually pretty good snippet you got there =)

    Man, I need to brush up on my C#......
     
  17. Unread #9 - Oct 11, 2008 at 12:48 PM
  18. hampe-92
    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    hampe-92 Forum Addict

    Webbrowser help

    thx :)
    and do so... cause it's realy fun :p
     
  19. Unread #10 - Oct 11, 2008 at 3:30 PM
  20. PinBuyer_
    Joined:
    Oct 10, 2008
    Posts:
    140
    Referrals:
    0
    Sythe Gold:
    3

    PinBuyer_ Active Member
    Banned

    Webbrowser help

    Heh that's what I was looking for, KeyCode.

    You can also do:

    e.KeyCode == 13
     
  21. Unread #11 - Oct 11, 2008 at 6:21 PM
  22. hampe-92
    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    hampe-92 Forum Addict

    Webbrowser help

    yea i know, but then u should use KeyPress, right?
    but Enter makes more sence than 13...
     
  23. Unread #12 - Oct 11, 2008 at 8:01 PM
  24. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    Webbrowser help

    Yes. The use of what is called "Magic numbers" is extremely bad practice.
     
  25. Unread #13 - Oct 12, 2008 at 2:07 PM
  26. hampe-92
    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    hampe-92 Forum Addict

    Webbrowser help

    yeah.. but how do u even know which button is which number anyway??
     
  27. Unread #14 - Dec 17, 2008 at 1:48 AM
  28. jokool
    Referrals:
    0

    jokool Guest

    Webbrowser help

    i want to stop a pop up box that keeps commin up on webpages wen im using opera, it says the informaton of title, address, encoding & MIME type

    can anyone help?
     
  29. Unread #15 - Dec 17, 2008 at 2:18 AM
  30. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    Webbrowser help

  31. Unread #16 - Dec 17, 2008 at 1:39 PM
  32. hampe-92
    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    hampe-92 Forum Addict

    Webbrowser help

    ah thx :) althought this is a realy old thread ;)
    and @jokool: you better get a own thread if you need help... and what has that to do with C# anyway??
     
< Tic-Tac-Toe Help [JCreator Pro] | Which Compiler should I use. >

Users viewing this thread
1 guest


 
 
Adblock breaks this site