-
click checkbox
ok in my webbrowser1 there will be a checkbox is there anyway to click it just bye the test next to it like in this picture it has "Remember me on this computer. " is there a code to click it just by giving it the text that is next to the checkbox ?
http://img14.imageshack.us/img14/9890/16748029.png
-
Re: click checkbox
What do you mean, do you mean you want a Checkbox remember me sort of thing?
if you do here is mine:
Code:
Public Class Login
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If CheckBoxChecked() = False Then
My.Settings.rememberchecked = False
My.Settings.rememberpass = ""
My.Settings.rememberuser = ""
End If
If CheckBoxChecked() = True Then
My.Settings.rememberchecked = CheckBox1.Checked
My.Settings.rememberpass = Password_TextBox.Text
My.Settings.rememberuser = Username_TextBox.Text
My.Settings.Save()
End If
End Sub
Private Sub Login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim checked As Boolean
checked = My.Settings.rememberchecked
If checked = False Then
Username_TextBox.Text = My.Settings.rememberuser
Password_TextBox.Text = My.Settings.rememberpass
CheckBox1.Checked = False
End If
If checked = True Then
Username_TextBox.Text = My.Settings.rememberuser
Password_TextBox.Text = My.Settings.rememberpass
CheckBox1.Checked = True
End If
End Sub
Private Function CheckBoxChecked() As Boolean
If CheckBox1.Checked = True Then
Return True
End If
If CheckBox1.Checked = False Then
Return False
End If
End Function
End Class
Code:
! Make sure you have the settings: rememberuser and rememberpass, rememberchecked and
your checkbox is CheckBox1. And the Sign in button is Button1 !
-
Re: click checkbox
No i want to click it thats it i wanted to know if i could click that checkbox just by the text next to it
-
Re: click checkbox
You can do something like this:
Code:
Dim outer As String = WebBrowser1.Document.All("cookieuser").OuterHtml
WebBrowser1.Document.All("cookieuser").OuterHtml = outer.Remove(outer.Length - 2) + " checked>"
Where cookieuser is the name of the checkbox.
-
Re: click checkbox
i know how to click it with the id for it i wanted to know if i could click it without knowing