Please help {Create my own webbrowser}
Please help {Create my own webbrowser}
Please help {Create my own webbrowser}
Please help {Create my own webbrowser}
Please help {Create my own webbrowser}
Please help {Create my own webbrowser} Please help {Create my own webbrowser} Please help {Create my own webbrowser} Please help {Create my own webbrowser} Please help {Create my own webbrowser} Please help {Create my own webbrowser} Please help {Create my own webbrowser} Please help {Create my own webbrowser}
Please help {Create my own webbrowser} Please help {Create my own webbrowser}
Please help {Create my own webbrowser}
Go Back  Xtreme Visual Basic Talk > > > Please help {Create my own webbrowser}


Reply
 
Thread Tools Display Modes
  #1  
Old 04-27-2005, 03:19 PM
cyberops cyberops is offline
Centurion
 
Join Date: Apr 2005
Posts: 192
Default Please Help browser input


I have a bit of a problem i ran into, im using the latest visual basic 2005 express beta 2 version.

Im trying to make my own webbrowser and want to be able to type in a url and then have a button click it and that the browser goes to that website. how can i make it work im completely lost.

im using a textbox1 and want the typed text that people enter be the website it goes to. any help is very welcome

Last edited by cyberops; 04-27-2005 at 04:46 PM.
Reply With Quote
  #2  
Old 04-28-2005, 04:03 PM
Iceplug's Avatar
IceplugPlease help {Create my own webbrowser} Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

Uhm... how are you planning on connecting to the internet?
Have you heard of the ActiveX WebBrowser component that other people seem to be using?
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #3  
Old 04-28-2005, 09:27 PM
cyberops cyberops is offline
Centurion
 
Join Date: Apr 2005
Posts: 192
Default

Quote:
Originally Posted by Iceplug
Uhm... how are you planning on connecting to the internet?
Have you heard of the ActiveX WebBrowser component that other people seem to be using?
the browser part works fine and connects without anyproblems to a website but how can i make so when i typed that url that it goes to the typed site.
Reply With Quote
  #4  
Old 04-30-2005, 07:31 AM
wayneph's Avatar
waynephPlease help {Create my own webbrowser} wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Quote:
Originally Posted by cyberops
the browser part works fine and connects without anyproblems to a website but how can i make so when i typed that url that it goes to the typed site.
When the user presses enter, or a "Go" button, you change the location of the web browser.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #5  
Old 05-01-2005, 04:15 PM
cyberops cyberops is offline
Centurion
 
Join Date: Apr 2005
Posts: 192
Default

Quote:
Originally Posted by wayneph
When the user presses enter, or a "Go" button, you change the location of the web browser.

ok that is what i want but what is the code for that to make it work ?
Reply With Quote
  #6  
Old 05-02-2005, 12:00 PM
iosys's Avatar
iosys iosys is offline
Junior Contributor
 
Join Date: Feb 2004
Location: Anaheim, CA
Posts: 224
Default

It should be something like...

webbrowser.navigate textbox.text
__________________
I'm on the web: Home | Programming | Engine | Music
Reply With Quote
  #7  
Old 05-03-2005, 05:37 PM
cyberops cyberops is offline
Centurion
 
Join Date: Apr 2005
Posts: 192
Default

That worked great, thanks for helping me out friend.
Reply With Quote
  #8  
Old 05-05-2005, 06:55 AM
cyberops cyberops is offline
Centurion
 
Join Date: Apr 2005
Posts: 192
Default

Another question, how would i go about linking the Internet Explorer favorites menu to a menu button in the application if u know what i mean. Also im making a status bar with it but how do i link it to show the current loading state of the website it's loading ?

Last edited by cyberops; 05-05-2005 at 07:58 AM.
Reply With Quote
  #9  
Old 05-05-2005, 08:00 AM
shiba126 shiba126 is offline
Centurion
 
Join Date: Jul 2003
Posts: 127
Default

Quote:
Originally Posted by cyberops
Another question, how would i go about linking the Internet Explorer favorites menu to a menu button in the application if u know what i mean.
Hmm.....If you're making your own product (I'm just assuming) - then why would you want to copy and use something of Microsoft's? Why not create your own Favourites listing? Granted it could be quite hard, but can be quite simple. I find that databases, XML files and good ol' INI files are the best for storing information.

If you created a database, you could just have one table with:

Code:
favourites 
  favouriteID
  favouriteTitle
  favouriteURL
This could save a lot of useless fuss with having to get the users special folders list and so on so that you can access their favourites folder.

However - those are just my thoughts, you don't have to pay any attention to me - I like to ramble....

Anyways, if you do want to access Window's special folders, then just type the following:

Code:
Dim favouritesPath As String favouritesPath = Environment.GetFolderPath(Environment.SpecialFolder.Favorites)

As for how to get the items out of the folder, I'll post back soon - I have to go now as I have a basketball match!

Chris
__________________
Posting Guidelines
Reply With Quote
  #10  
Old 05-05-2005, 08:10 AM
cyberops cyberops is offline
Centurion
 
Join Date: Apr 2005
Posts: 192
Default

thanks for the help , yes im thinking about making my own favorites someday but for now just want to have it linked to the favorites menu of internet explorer. also brings me to my next question how do i make it when people click a link in the browser that it will open a new window in the browser im making rather then IE.
Reply With Quote
  #11  
Old 05-07-2005, 06:02 AM
cyberops cyberops is offline
Centurion
 
Join Date: Apr 2005
Posts: 192
Default

Quote:
Originally Posted by shiba126
As for how to get the items out of the folder, I'll post back soon - I have to go now as I have a basketball match!

Chris
I hope you can still help me out with it
Reply With Quote
  #12  
Old 05-09-2005, 02:56 AM
shiba126 shiba126 is offline
Centurion
 
Join Date: Jul 2003
Posts: 127
Default

Hey,

Lol, I had the same problem with opening a pop up in my own Internet window. It has something to do with the NewWindow event on the webbrowser control - I can get it to go to that event, but I can't actually retrieve the URL that the new window is going to!

Anyway,

Do get the list of favorites, use the following:

Code:
Sub GetFavourites() Dim myFiles As IO.FileInfo Dim favouritesPath As String = Environment.GetFolderPath(favorites) Dim myFolder As New IO.DirectoryInfo(favouritesPath) For Each myFiles In myFolder.GetFiles("*.url") 'I used a listbox to store them to see if it worked: ListBox1.Items.Add(myFiles.Name) Next End Sub

That will get the favourites from the folder on the first level, as for subdirectories in the Favourites list, then I can't remember how to get there so hopefully someone else can assist!

However, now that I have looked into it, I advise not trying to use the IE Favourites list. This is because it's quite hard to get the URL out of the file, when I opened one of the URL files (I had to create an app to do this as when I tried doing it through NotePad it actually got the source of the webpage of the shortcut! Stupid thing), the contents of the .URL file look like this:

Code:
[DEFAULT]
BASEURL=http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=2613&lngWId=10
[InternetShortcut]
URL=http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=2613&lngWId=10
Modified=50FEB118A34AC501CA
IconFile=http://www.planetsourcecode.com/favicon.ico
IconIndex=1
As you can see it could be quite hard to parse the URL out of that lot!

Hang on, I spose what you could do -

Code:
Sub NavigateFavourite(ByVal URLFile As String) 'The URLFile holds the address of the .URL file from the favourites folder WebBrowser1.Navigate(URLFile) End Sub

So you could just get the webbrowser to navigate straight to the .URL file, and that would redirect it to the correct webpage!

lol, see if it works as that was just off the top of my head!

Chris
__________________
Posting Guidelines
Reply With Quote
  #13  
Old 05-09-2005, 05:52 AM
cyberops cyberops is offline
Centurion
 
Join Date: Apr 2005
Posts: 192
Default

Thanks for the help, now if you could help me one more time to explain what do i have to put in as a code when i try to do the following.

I have the toolbar where the menu's and all are in there i want a button that pops up the menu of the favorites. I wanted it to make it possible for people to add favorites to it and also browse trough them.
Reply With Quote
  #14  
Old 05-09-2005, 08:12 AM
shiba126 shiba126 is offline
Centurion
 
Join Date: Jul 2003
Posts: 127
Default

Ok...I won't actually write all of the code for you, that's not why we're here - we're here for advise.

Hint 1:
Use the panel control, along with a listbox. Add the panel to the form, and under the Dock property, set it to dock to the left hand side. Then you can set the width to 0 so that it isn't visible. When the user clicks on the toolbar, you can then either put one simple piece of code in, which increases the size of the panel, and fills it with all of the details, or you could use this to kind of "slide" the bar out.

Code:
Sub ViewFAvourites_Click() Dim i as integer If PanelFavourites.Width = 0 Then For i = 0 To 250 PanelFavourites.Width += +1 '## Increases width by one each time until it = 250 Next Else For i = 0 To 250 PanelFavourites.Width += -1 Next End If End Sub

In the listbox, just use the code that I have posted previously so that you can fill the listbox with all of favourites, and in the Click() procedure, you can do what you want.

Hint 2.
When they click the add button, ask for the URL and the title, then use the FileSystemObject(COM) to write a new .URL file in the right place, and place the content of the URL file that I've already posted above, into it. Except replace the addresses with the new ones.

Chris
__________________
Posting Guidelines
Reply With Quote
  #15  
Old 05-09-2005, 11:59 AM
cyberops cyberops is offline
Centurion
 
Join Date: Apr 2005
Posts: 192
Default

Im glad your helping me but i still cant figure it out, dont forget im a newbie.
Reply With Quote
  #16  
Old 05-09-2005, 02:51 PM
shiba126 shiba126 is offline
Centurion
 
Join Date: Jul 2003
Posts: 127
Default

Quote:
Originally Posted by cyberops
Im glad your helping me but i still cant figure it out, dont forget im a newbie.
Okey dokes - we all started somewhere!

Hmm....I just went to create a new project to attach to this thread, and found that navigating through the webbrowser control to the .URL file, brings up the save file asking if you want to save, open or cancel the download. Back to the drawing board...
__________________
Posting Guidelines
Reply With Quote
  #17  
Old 05-09-2005, 04:46 PM
cyberops cyberops is offline
Centurion
 
Join Date: Apr 2005
Posts: 192
Default

Quote:
Originally Posted by shiba126
Okey dokes - we all started somewhere!

Hmm....I just went to create a new project to attach to this thread, and found that navigating through the webbrowser control to the .URL file, brings up the save file asking if you want to save, open or cancel the download. Back to the drawing board...

Well thanks for all the help and indeed we all have to start somewhere and making my own browser is a start for me trying to make something. So all the help your giving me is very much apreciated.
Reply With Quote
  #18  
Old 05-10-2005, 07:21 AM
shiba126 shiba126 is offline
Centurion
 
Join Date: Jul 2003
Posts: 127
Default

Quote:
Originally Posted by cyberops
Well thanks for all the help and indeed we all have to start somewhere and making my own browser is a start for me trying to make something. So all the help your giving me is very much apreciated.

lol, I've got some kind of parsing tool done at home now - I managed to hack it together last night, so I'll post it later on this evening
__________________
Posting Guidelines
Reply With Quote
  #19  
Old 05-10-2005, 11:09 AM
cyberops cyberops is offline
Centurion
 
Join Date: Apr 2005
Posts: 192
Default

Quote:
Originally Posted by shiba126
lol, I've got some kind of parsing tool done at home now - I managed to hack it together last night, so I'll post it later on this evening
Great im looking forward to it, cant wait to get it working
Reply With Quote
  #20  
Old 05-10-2005, 02:06 PM
shiba126 shiba126 is offline
Centurion
 
Join Date: Jul 2003
Posts: 127
Default

Right - this project that I've made is in VB .NET 2005 Beta 2.

I have used a splitcontainer. 1 panel holds a listbox which holds a list of the favourites. The other holds the webbrowser control. Now, what happens is, when the form is loaded, the 1st panel with the favourites listbox in is set with a width to 0 - so that it is seemingly invisible. When the user clicks on the Favourites button on the toolbar at the top, the SplitContainer1.SplitterDistance is set to 165 - which makes the width of the first panel 165. It also fills the listbox with all of the .URL files in the users Favourites folder.

In the ListBox_DoubleClick procedure, I have used the FileSystemObject from VB6 (Imported into VB.NET as a COM component - not too worry too much about that, but the reference should be made) When the user double clicks an item, the file is located and opened as a text file, and it reads through the file.

The contents of a file would look like:

Code:
[DEFAULT]
BASEURL=http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=2613&lngWId=10
[InternetShortcut]
URL=http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=2613&lngWId=10
Modified=50FEB118A34AC501CA
IconFile=http://www.planetsourcecode.com/favicon.ico
IconIndex=1
The Function GetURL goes through the text letter by letter until it finds the "=" character, everything after that it stores into a variable called URL, until the character is "[" - this means that the end of the URL has been reached, so it exits the Function, returning the URL from the .URL file.

So all you need to do in the DoubleClick procedure for the listbox is:

Code:
Sub ListBox_DoubleClick(sender as Object, e As System.EventArgs) webbrowser.navigate(GetURL(Environment.GetFolderPath(Favorites) & "\" & ListBox.Text)) End Sub

The code above would call the function, returning the URL from the Favourites file - and hence the WebBrowser would navigate to that URL!

Maybe my explanation was a little long winded - but still, it works! Post back if you need further guidance with the code

Chris
Attached Files
File Type: zip Get Favourite.zip (82.7 KB, 12 views)
__________________
Posting Guidelines
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Please help {Create my own webbrowser}
Please help {Create my own webbrowser}
Please help {Create my own webbrowser} Please help {Create my own webbrowser}
Please help {Create my own webbrowser}
Please help {Create my own webbrowser}
Please help {Create my own webbrowser} Please help {Create my own webbrowser} Please help {Create my own webbrowser} Please help {Create my own webbrowser} Please help {Create my own webbrowser} Please help {Create my own webbrowser} Please help {Create my own webbrowser}
Please help {Create my own webbrowser}
Please help {Create my own webbrowser}
 
Please help {Create my own webbrowser}
Please help {Create my own webbrowser}
 
-->