Help Web Browser Open File Dialog Problems

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2008
Posts: 3
Reputation: Lumnous is an unknown quantity at this point 
Solved Threads: 0
Lumnous's Avatar
Lumnous Lumnous is offline Offline
Newbie Poster

Help Web Browser Open File Dialog Problems

 
0
  #1
Nov 1st, 2008
Hello I'm new here and im a bit confused about a certain code i am trying to do.
The code is for opening the file dialog and when the object has been selected it would be shown in the web browser or open any file, the code i have done opens the file dialog box, but as too is this well the web browser starts to navigate thinking it can find the file but it always does not. Can anyone help with this problem i am having please ?.I am also unsure about how you can make custom settings and how they can work, the reason i want to know this is because i have made a transparency slider and also has a form colour changer, I just do not know how to get these prefrences set for the user so when he/she opens the form up it will be how they selected it.

Here is the code for the open file dialog problem i am having
  1. Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
  2. WebBrowser1.Navigate(OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK)
  3. End Sub
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 114
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: Help Web Browser Open File Dialog Problems

 
0
  #2
Nov 2nd, 2008
The code won't open a file since it never gets any file name. Try it this way:
  1. Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
  2. If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
  3. WebBrowser1.Navigate(OpenFileDialog1.FileName)
  4. End If
  5. End Sub
now it may or may not open and show the file in the control. If you try to open exe or similar file, you'll get IE's "Run/Save/Cancel" -dialog.

What custom settings? Please, be more specific.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 3
Reputation: Lumnous is an unknown quantity at this point 
Solved Threads: 0
Lumnous's Avatar
Lumnous Lumnous is offline Offline
Newbie Poster

Re: Help Web Browser Open File Dialog Problems

 
0
  #3
Nov 2nd, 2008
Originally Posted by Teme64 View Post
The code won't open a file since it never gets any file name. Try it this way:
  1. Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
  2. If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
  3. WebBrowser1.Navigate(OpenFileDialog1.FileName)
  4. End If
  5. End Sub
now it may or may not open and show the file in the control. If you try to open exe or similar file, you'll get IE's "Run/Save/Cancel" -dialog.

What custom settings? Please, be more specific.
Its worked thankyou very much and what i mean by custom settings is like, Opacity on a slider, when they open the dialog box it will keep what they selcted to like 15% visible it would open the next time they would see it at 15% visibility
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 114
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: Help Web Browser Open File Dialog Problems

 
0
  #4
Nov 3rd, 2008
One way is to store the value in application settings. From Project-menu select "<proj name> Properties" and Settings-tab. Add a new setting: SliderOpacity which type is Integer. You may also give it an initial value 15.

In your code you set and save the setting:
  1. My.Settings.Item("SliderOpacity") = 15
  2. My.Settings.Save()
and read the setting:
  1. Dim Opacity As Integer
  2. Opacity = CInt(My.Settings.Item("SliderOpacity"))
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 3
Reputation: Lumnous is an unknown quantity at this point 
Solved Threads: 0
Lumnous's Avatar
Lumnous Lumnous is offline Offline
Newbie Poster

Re: Help Web Browser Open File Dialog Problems

 
0
  #5
Nov 3rd, 2008
Originally Posted by Teme64 View Post
One way is to store the value in application settings. From Project-menu select "<proj name> Properties" and Settings-tab. Add a new setting: SliderOpacity which type is Integer. You may also give it an initial value 15.

In your code you set and save the setting:
  1. My.Settings.Item("SliderOpacity") = 15
  2. My.Settings.Save()
and read the setting:
  1. Dim Opacity As Integer
  2. Opacity = CInt(My.Settings.Item("SliderOpacity"))
Will that work ? i mean its one of them sliders things and it has multiple if statements so that if like....the ticker is on 9 it would be 50% visible. I'm sorry i cant post there codes right now I'm at college I am afraid.Seeing as i am at college at this very moment i better at least mention it's one of them ticker sliders and the default value is 18 could it corrupt the system?, and how would a background color work too ?. Thank you very much for the info on that code, since having had that information i have been able to open anything i want in my web browser including PDF files +Rep for you.
Last edited by Lumnous; Nov 3rd, 2008 at 10:00 am. Reason: Forgot to say thankyou
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC