473,414 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

listbox1 nagivate to url

My program Extracts certain urls to a Listbox

Example listbox1 urls
http://www.thescripts.com/forum/newthread.php?do=newthread&f=132
http://www.thescripts.com/forum/newthread.php?do=newthread&f=131
http://www.thescripts.com/forum/newthread.php?do=newthread&f=130
http://www.thescripts.com/forum/newthread.php?do=newthread&f=135

I would like to be able to click the url in the linkbox and it will load on the actuall program, using web broswer controls

Can anyone help me>?

Thanks
Feb 22 '07 #1
8 2682
willakawill
1,646 1GB
Hi. Do you have a web browser control on your form?
Feb 22 '07 #2
yes im using it

i used this code

Expand|Select|Wrap|Line Numbers
  1. If List1.ListIndex <> -1 Then
  2.         MousePointer = 11  ' sets the cursor to an hourglass
  3.         WebBrowser1.navigate (List1.Text)
  4.         MousePointer = 0   ' sets the cursor back to the default arrow
  5.     Else
  6.         MsgBox "Click on a web site in the list first."
  7.     End If
But u have to click the url inthe listbox and press a command button to go to that url

Is there anyway to make it automatically go down the list and connect to the first one url then sec, then third..So on..(inorder) inside listbox?
Feb 22 '07 #3
willakawill
1,646 1GB
Your listbox has a click event. double click on the listbox in design view and the code will write itself. When the listbox has the focus and you navigate using the up / down arrows this will fire the click event and you can test the output like this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub List1_Click()
  2.    MsgBox Me.List1.Text
  3. End Sub
Feb 22 '07 #4
I tired that, It just opens a msg box after i click the url in the list box..

I Just want to Click a Command button, and it will Automatically open the first Url in the list box.. fill in a text field and submit a button

Than it will automatically click the second url and ect...



I really appreciate your help :)
Feb 22 '07 #5
I started a forum and as everyone probably knows, its good to have topics and users and not be blank


So this program will help my forum take off(well i hope)

Thanks again
Feb 22 '07 #6
willakawill
1,646 1GB
It is supposed to open a msgbox as a test to show that the click event is working. It is then up to you to replace the msgbox code with your browser code
Expand|Select|Wrap|Line Numbers
  1. Private Sub List1_Click()
  2.    MsgBox Me.List1.Text
  3.    'replace the msgbox code above with code to
  4.    'pass the url (Me.List1.Text) to your browser
  5. End Sub
Feb 22 '07 #7
Sorry, but i still dont understand that

can you give me an example

Thanks soo much
Feb 22 '07 #8
Nevermind i got it work..Thanks

Expand|Select|Wrap|Line Numbers
  1. Private Sub List1_Click()
  2.     WebBrowser1.navigate (Me.List1.Text)
  3.    'replace the msgbox code above with code to
  4.    'pass the url (Me.List1.Text) to your browser
  5. End Sub
  6.  

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command3_Click()
  2.  
  3. Dim HTML As HTMLDocument
  4.  
  5. Dim INP As HTMLInputElement
  6.  
  7. Set HTML = WebBrowser1.document
  8.  
  9. For Each INP In HTML.getElementsByTagName("input")
  10.     If INP.Type = "button" Then
  11.  
  12.         'Check the ALT, NAME, SRC, ID, onlcick, etc
  13.  
  14.         'Look for Submit, Login, or whatever this button is doing
  15.  
  16.         If INP.alt = "Submit" Or INP.Name = "addcomment" Or INP.Value = "Submit" Then
  17.  
  18.             INP.Click
  19.         End If
  20.  
  21.     End If
  22. Next
  23. End Sub
  24.  
this code clicks a button(as you prob already know)

So now , how can i make it so when i click the command button it submits and then goes to the next url on the list?
Feb 22 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: houstoncity | last post by:
Hi, I am wondering how to write the code that allows navigating to different pages based on user response. I have one question on the first page that has option (a), (b), (c), and (d) for the...
4
by: Bilo | last post by:
I dont know what i am doing false. the code : private void button2_Click(object sender, System.EventArgs e) { foreach (string filename in listBox1.SelectedItems)...
0
by: Goober at christianDOTnet | last post by:
I'm wanting to fix the following on a web page without really re-inventing anything. What I have is a vb web page with a radiobuttonlist where I can pick Current or History year. Underneath...
2
by: Jan | last post by:
Hi there, I'm a newbee in vb.net with the following problem: 4444528; Baltic Birch; 16.20; 0 I have more of these lines in a ListBox1. Now I want to change the latest 0 with the...
1
by: Jan | last post by:
Hi there, Is there a solution to the following problem: I've got a button1 in form2, with this button1 I want to fill a listbox in form1. How can I make listbox1 in form1 accesable for...
2
by: Bernie Yaeger | last post by:
I want to open a window with a listbox (custlist) in it, but I want to automatically select a certain item in the listbox, and have it be the correct selectedindex. The call to open this window...
2
by: Krupau | last post by:
Hi Friends, I am getting following error message.. I am so fed up of this error. I am trying to solve it so long time. Please help me!! .Thanks in advance... Object reference not set to an...
5
by: BlackBox | last post by:
I have a Listbox1 in the main form and I can add listbox1 items in the parent form. But when I close the parent form Listbox1 in the main form does not get refresh. I need to re-open the app. ...
3
by: rprasad79 | last post by:
Hi Team, Here goes the scenario... i have a listbox1 which contains continent details. if i select any one of the continent, then the next list box which contains the country list should display...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.