Hi,
To begin with you should be using the Random Class in .NET rather than the legacy Rnd function that was introduced with earlier versions of VB. Using this calss, here is a streamlined version of your code:-
Hope that helps.Code:Dim myRandom As New Random Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim strSelectedGroup As String = "radiogroup" & myRandom.Next(0, 3).ToString For Each ele As HtmlElement In WebWindow.WebBrowser1.Document.All If ele.GetAttribute("id").ToLower = strSelectedGroup Then ele.InvokeMember("click") End If Next End Sub
Cheers,
Ian




Reply With Quote