How to auto check a checkbox ?

B

Boki

Hi All,

About the webbrowser, I can do the auto fill in text now.

Now, I have another problem, I can't do auto check a checkbox.
Whatever what value I set to the checkbox, it is still showing un-
checked.

Could you please advice ?


Best regards,
Boki.
 
B

Boki

Hi All,

About the webbrowser, I can do the auto fill in text now.

Now, I have another problem, I can't do auto check a checkbox.
Whatever what value I set to the checkbox, it is still showing un-
checked.

Could you please advice ?

Best regards,
Boki.

Here is the code:

HtmlDocument DOC = webBrowser1.Document;
DOC.All["checkbox_no1"].SetAttribute("value", "1");

After the code ran, it is still show empty.

Boki.
 
B

Boki

About the webbrowser, I can do the auto fill in text now.
Now, I have another problem, I can't do auto check a checkbox.
Whatever what value I set to the checkbox, it is still showing un-
checked.
Could you please advice ?
Best regards,
Boki.

Here is the code:

HtmlDocument DOC = webBrowser1.Document;
DOC.All["checkbox_no1"].SetAttribute("value", "1");

After the code ran, it is still show empty.

Boki.

I saw there is a way by VB:

WebBrowser1.Document.All.PersistentCookie.Checked = True

But I think there is a different way in C#, could you please advice ?

Thank you!

Best regards,
Boki.
 
M

Mr. Arnold

Boki said:
About the webbrowser, I can do the auto fill in text now.
Now, I have another problem, I can't do auto check a checkbox.
Whatever what value I set to the checkbox, it is still showing un-
checked.
Could you please advice ?
Best regards,
Boki.

Here is the code:

HtmlDocument DOC = webBrowser1.Document;
DOC.All["checkbox_no1"].SetAttribute("value", "1");

After the code ran, it is still show empty.

Boki.

I saw there is a way by VB:

WebBrowser1.Document.All.PersistentCookie.Checked = True

But I think there is a different way in C#, could you please advice ?

If it can be done that way in VB, then the same thing applies to C# too or
very close to it. If you see a C# example, then it can be done the same way
in VB or very close to it.

There is really no difference in the way C# or VB will use a statement like
the one above --- none.
 
P

Peter Duniho

I have done. :)

It is traditional, should you happen to find your answer somewhere else,
to include the solution to your question as a follow-up to your original
question.

Half of the benefit of a newsgroup is that others can review the
discussion later, in case there's a question they have that's already been
answered. If you ask the question but don't provide the answer, you've
just prevented that half of the benefit from occuring (the other half is,
of course, to be able to obtain answers oneself).

In other words: please post what the actual answer to your question turned
out to be.

Pete
 
J

James Irvine

Boki said:
Hi All,

About the webbrowser, I can do the auto fill in text now.

Now, I have another problem, I can't do auto check a checkbox.
Whatever what value I set to the checkbox, it is still showing un-
checked.

Could you please advice ?


Best regards,
Boki.


CheckBox1.Checked = true;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top