Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 28th, 2006, 12:07 AM
Authorized User
 
Join Date: Sep 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to automate selection of radio buttons using v

Hi,
Can anybody help me!!!!!!
how to automate selection of radio buttons using vb.net.
I am using mshtml.htmldocument

Public Sub OpenDownloadDataPage(ByRef wbBrowser As SHDocVw.InternetExplorer)

Dim HTMLDoc1 As mshtml.HTMLDocument
Dim iHtmlCol As IHTMLElementCollection
Dim iHtmlEle As IHTMLElement
Dim str1 As String


Do
Loop Until Not wbBrowser.Busy

HTMLDoc1 = wbBrowser.Document
iHtmlCol = HTMLDoc1.getElementsByTagName("a")

' Press the anchor tag to open DownloadData page
For Each iHtmlEle In iHtmlCol
If Not iHtmlEle.outerText Is Nothing Then
If iHtmlEle.outerText.ToLower = "Download Data".ToLower Then
iHtmlEle.click()
Exit For
End If
End If
Next
'Select Radio Buttons
For Each iHtmlEle In iHtmlCol
If Not iHtmlEle.getAttribute("name") Is Nothing Then
str1 = iHtmlEle.getAttribute("name").ToString
If str1 = "KWH" Then
If iHtmlEle.outerHTML = "<input type=radio" & _
" name=demcons value=kwh checked " & _
"> " Then

iHtmlEle.click()
Exit For
End If

End If

End If



Next


Do
Loop Until Not wbBrowser.Busy

End Sub


Satishk





 
Old September 28th, 2006, 12:11 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Cross post.

http://p2p.wrox.com/topic.asp?TOPIC_ID=50301

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to automate selection of radio button using vb satish_k VB.NET 11 December 14th, 2006 11:28 AM
how to automate selection of items from list satish_k VB How-To 0 October 6th, 2006 06:44 AM
how to automate selection of radio buttons using v satish_k Pro VB.NET 2002/2003 1 September 28th, 2006 09:46 AM
how to automate selection of radio buttons using v satish_k Excel VBA 0 September 27th, 2006 07:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.