none
c# web browser click on button RRS feed

  • Question

  • hey guys 

    need help!!

    in web game have this 

    <div id="hmenu" style="left: 217px; top: 234.5px; display: block; ">

    <div id="h-orn1"></div>

    <div id="h-orn2"></div>

    <button onclick="_g(&quot;takeitem&quot;)">Podnieś</button>

    <br>

    <button onclick="_g(" walk")"="">Przejdź</button>

    <br>

    <button onclick="_g(&quot;emo&amp;a=angry&quot;)" class="last">Złość się</button>

    <br></div>

     

    and if i

    usewebBrowser1.Document.GetElementById("hero").InvokeMember("click");

    open this menu but i want click on "<button onclick="_g(" walk")"="">Przejdź</button>"

    and i dont know how do this

     

    broxis.

    Saturday, December 31, 2011 4:37 PM

Answers

  • I don't understand your code.

    You call for an element with ID "hero". But there is no such ID in the code that you have provided.

    Regarding your issue, you need to have an ID, and then use the invoke.

     

    Noam B.



    Do not Forget to Vote as Answer/Helpful, please. It encourages us to help you...
    • Proposed as answer by Noam B Sunday, January 1, 2012 12:18 PM
    • Marked as answer by Dummy yoyo Monday, January 9, 2012 3:50 AM
    Saturday, December 31, 2011 10:11 PM

All replies

  • Hi.. Broxis..
    Welcomes you to MSDn forums..
    In your web related queries, post the below forums for getting quick reponse
    By
    A Pathfinder..
    JoSwa

    If you find an answer helpful, click Vote as helpful button. If you find an answer to your question, Click mark it as the answer.
    Saturday, December 31, 2011 5:39 PM
  • I don't understand your code.

    You call for an element with ID "hero". But there is no such ID in the code that you have provided.

    Regarding your issue, you need to have an ID, and then use the invoke.

     

    Noam B.



    Do not Forget to Vote as Answer/Helpful, please. It encourages us to help you...
    • Proposed as answer by Noam B Sunday, January 1, 2012 12:18 PM
    • Marked as answer by Dummy yoyo Monday, January 9, 2012 3:50 AM
    Saturday, December 31, 2011 10:11 PM