Home > Net >  Vb.net how to choose a Webbrowser web pages in the drop-down menu in operation, select an option
Vb.net how to choose a Webbrowser web pages in the drop-down menu in operation, select an option

Time:04-03

Everybody is good! I was dizzy brain expand beginners, exploration, I got stuck there is a problem, several days didn't find out the solution









Above is web lower selection menu source code, how to select one of the options in WB controls? O code

Is it WebBrowser1. Document. GetElementById (" shuiguo ")????? Behind (I don't know, I cry)

Ask everybody to help, thank you

CodePudding user response:

 Private Sub Button1_Click (sender As Object, As EventArgs e) Handles for. Click 
Button2. Enabled=False
WebBrowser1. Navigate (E:\code\VB.NET \ WinFormsApp1 \ "WinFormsApp1 \ bin \ Debug \ net5.0 - Windows \ aaa. HTML")
End Sub

Private Sub WebBrowser1_DocumentCompleted (sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1. DocumentCompleted
Button2. Enabled=True
End Sub

Private Sub Button2_Click (sender As Object, As EventArgs e) Handles Button2. Click
Dim browser As WebBrowser=Me. WebBrowser1
Dim element_select As HtmlElement=browser. Document. GetElementById (" shuiguo ")
Element_select. Children (1). The SetAttribute (" selected ", "selected") 'key is the
End Sub


Interface 2 button, drag a webbrowser can see effect
  • Related