[Help]weird problem with my code

Posts 1–7 of 7 · Page 1 of 1
[Help]weird problem with my code
i know this code works in vs 2008
Code:
WebBrowser1.Document.All.GetElementsByName("name").InvokeMember("Click")
but i got VS 2010 pro like 2 days ago and i tried to use it and i get a lil syntax error(i guess it would be a syntax error). here is a pic i have tried typing it out by hand c&p but it wont work so i was just wondering if there is anything wrong with this...(YES I DID GOOGLE IT I FOUND NOTHING)

Quote Originally Posted by trevor206 View Post
i know this code works in vs 2008
Code:
WebBrowser1.Document.All.GetElementsByName("name").InvokeMember("Click")
but i got VS 2010 pro like 2 days ago and i tried to use it and i get a lil syntax error(i guess it would be a syntax error). here is a pic i have tried typing it out by hand c&p but it wont work so i was just wondering if there is anything wrong with this...(YES I DID GOOGLE IT I FOUND NOTHING)

Posting the error it's giving you would be a smart idea don't you think?
Try GetElement instead of GetElements...without the exact error we cannot help you.
Quote Originally Posted by Imported View Post


Posting the error it's giving you would be a smart idea don't you think?
Quote Originally Posted by Blubb1337 View Post
Try GetElement instead of GetElements...without the exact error we cannot help you.
mb guys i forgot to post the error here it is. Error 1 'InvokeMember' is not a member of 'System.Windows.Forms.HtmlElementCollection'.

also blubb that did not work.
Quote Originally Posted by trevor206 View Post
mb guys i forgot to post the error here it is. Error 1 'InvokeMember' is not a member of 'System.Windows.Forms.HtmlElementCollection'.

also blubb that did not work.
Could I ask you where you learn to read? Read the error, you're getting a problem with your "InvokeMember" addition to the code.

Try this:

[php]
WebBrowser1.Document.GetElementById("LALALALA").In vokeMember("click")
[/php]
However the element doesn't have an ID, it only has a name.
Quote Originally Posted by Jason View Post


Could I ask you where you learn to read? Read the error, you're getting a problem with your "InvokeMember" addition to the code.

Try this:

[php]
WebBrowser1.Document.GetElementById("LALALALA").In vokeMember("click")
[/php]
Quote Originally Posted by Lolland View Post
However the element doesn't have an ID, it only has a name.

yeah it doesn't have an id if it did i wouldn't be asking this although i shouldn't be asking this because it should work but it doesn't.
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us