GingerCode
New member
- Joined
- Aug 14, 2014
- Messages
- 4
- Programming Experience
- Beginner
I have an application I am working on where I would like to take all of the items of my list box and pass them into a URL and launch it in internet explorer. I have it all working except one small detail. Everytime I run my code it opens a new window instead of a new tab in internet explorer. Obviously it is because I am using process.start multiple times in my for loop.
Any ideas please?
Any ideas please?
VB.NET:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim testbool As Boolean = True
For i = 0 To ListBox1.Items.Count - 1
ListBox1.SetSelected(i, True)
Dim urlstring As String
urlstring = "https://www.google.com/search?q=" & ListBox1.SelectedItem & "&oq=test&aqs=chrome..69i57j69i60j0l2j69i59j0.658j0j9&sourceid=chrome&es_sm=93&ie=UTF-8"""
Process.Start("IExplore.exe", urlstring)
Threading.Thread.Sleep(5000)
If testbool = False Then
SendKeys.Send("^(t)")
End If
testbool = False
Next
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
For Each s As String In Me.TextBox1.Lines
Dim nextLineText As String = s
ListBox1.Items.Insert(0, s)
Next
TextBox1.Focus()
TextBox1.Text = String.Empty
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
TextBox1.Multiline = True
End Sub
End Class