|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Automaticaly Clicking a Checkbox on a webbrowser controlI know there is probably a simple solution to this, but I haven't
figured it out yet or seen it else where. Imagine you had a simple web page that looked like the following: <html> <input name="dgSelect:_ctl0:cbSelect" id="dgSelect__ctl0_cbSelect" type="checkbox" /> </html> After loading this web page in to a WebBrowser Control on a VB form, how would you have VB check the box? I know this seems simple and it's probably so easy that nobody has bothered to ask it before, but I can't figure it out and haven't seen a solution for it yet so I thought I'd ask. kb This is not VB, it is simple HTML. Include CHECKED in the attribute list.
T Colliers***@gmail.com wrote: Show quoteHide quote >I know there is probably a simple solution to this, but I haven't >figured it out yet or seen it else where. > >Imagine you had a simple web page that looked like the following: > ><html> ><input name="dgSelect:_ctl0:cbSelect" id="dgSelect__ctl0_cbSelect" >type="checkbox" /> ></html> > >After loading this web page in to a WebBrowser Control on a VB form, >how would you have VB check the box? I know this seems simple and it's >probably so easy that nobody has bothered to ask it before, but I can't >figure it out and haven't seen a solution for it yet so I thought I'd >ask. > >kb > > > Sorry I don't think I was being clear enough, I don't have control
over the creation of the page, it's a 3rd party page. I figured out what I was trying to do though. I was trying to make a function that will check every checkbox on a page that is loaded into a webbrowser1 control. There was no preexisting attribute "Checked" on the checkboxes so I didn't think that I could set it directly, but the code below works. hopefully this will help someone out. private sub Check_all_checkboxes() Dim doc As HtmlDocument Dim elem As HtmlElement doc = WebBrowser1.Document For Each elem In doc.All If elem.GetAttribute("type") = "checkbox" Then elem.SetAttribute("CHECKED", "CHECKED") End If Next End Sub tomb wrote: Show quoteHide quote > This is not VB, it is simple HTML. Include CHECKED in the attribute list. > > T > > Colliers***@gmail.com wrote: > > >I know there is probably a simple solution to this, but I haven't > >figured it out yet or seen it else where. > > > >Imagine you had a simple web page that looked like the following: > > > ><html> > ><input name="dgSelect:_ctl0:cbSelect" id="dgSelect__ctl0_cbSelect" > >type="checkbox" /> > ></html> > > > >After loading this web page in to a WebBrowser Control on a VB form, > >how would you have VB check the box? I know this seems simple and it's > >probably so easy that nobody has bothered to ask it before, but I can't > >figure it out and haven't seen a solution for it yet so I thought I'd > >ask. > > > >kb > > > > > >
What is the correct format for DateTime.Compare ?
Using values from one useform in another userform Difficult Task Capturing the second column data from a list view box. hyperlink text ISDATE() took 8 seconds to complete ? Am I doing this right? client side dataset and dataset force immediate VS05 compile? Edit/Delete row in datasets table |
|||||||||||||||||||||||